Re: Potential threading bug in MemoryMessageStore.

2015-06-21 Thread Tim Bain
But that's the thing; I think that method is properly synchronized, and many of the other methods are over-synchronized. Here's the code in question: from http://grepcode.com/file/repo1.maven.org/maven2/org.apache.activemq/activemq-osgi/5.11.1/org/apache/activemq/store/memory/MemoryMessageStore.ja

Re: Potential threading bug in MemoryMessageStore.

2015-06-20 Thread Kevin Burton
I didn’t.. it’s a race so if it’s happening is probably happening not that often . Maybe a test could be created to try to introduce the race. On Thu, Jun 18, 2015 at 9:57 PM, Tim Bain wrote: > Did you look at this any further? Looking at the code, it looks like the > call will be protected wi

Re: Potential threading bug in MemoryMessageStore.

2015-06-18 Thread Tim Bain
Did you look at this any further? Looking at the code, it looks like the call will be protected without explicit synchronization by the intrinsic lock on the synchronizedMap (and I think that some other methods such as delete() and addMessage() that just call a method on the synchronizedMap could

Potential threading bug in MemoryMessageStore.

2015-04-06 Thread Kevin Burton
Pretty sure getMessage() in MemoryMessageStore has a bug. All access to messageTable is synchronized. this method is not. This means that there’s a race where a message can go into the queue but the thread reading it may have a cache copy of the data structure meaning it would get a cache miss