[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - JBMESSAGING-565 - Race condition on QueueManagementTest
clebert.suconic@jboss.com
do-not-reply at jboss.com
Fri Sep 29 02:13:08 EDT 2006
This thread is to discuss the racing condition between getMessageCount and Delivery Thread.
Just for convenience I have copied the JIRA description which has some relevant information for this discussion.
anonymous wrote :
| QueueManagementTest::testMessageCountOverFullSize has a race condition between getMessageCount and Deliver Thread.
|
| PagingChannelSupport::messageCount is an arithmethic expressions of messageRefs.size() + deliveries.size() + nextPagingOrder - firstPagingOrder
|
| deliveries.size is being controlled by Delivery Thread, determined by DeliveryRunnable that runs as-synchronously on Destination.
|
| While getMessageCount might diverge momentarily it will eventually be fixed as soon as DeliveryRunnable has the appropriate time to send the result to the collection deliveries.
|
| To fix this we would need to synchronize delivery and messageCount somehow, probably adding global lock, what we don' t want to add I assume. So, if this is correct the test has to be fixed somehow.
|
| I have changed the test in such way it will make easier to identify the racing condition. Use tracing in your tests and you will see a retry routine that will eventually pass.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3975072#3975072
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3975072
More information about the jboss-dev-forums
mailing list