[jboss-jira] [JBoss JIRA] Created: (JBMESSAGING-565) Race Condition between Topic/Queue.getMessageCount and Deliver Thread
Clebert Suconic (JIRA)
jira-events at jboss.com
Fri Sep 29 02:11:41 EDT 2006
Race Condition between Topic/Queue.getMessageCount and Deliver Thread
---------------------------------------------------------------------
Key: JBMESSAGING-565
URL: http://jira.jboss.com/jira/browse/JBMESSAGING-565
Project: JBoss Messaging
Issue Type: Bug
Affects Versions: 1.2.0.Alpha1
Reporter: Clebert Suconic
Assigned To: Ovidiu Feodorov
Fix For: 1.2.0.Alpha2
This is not necessarily a bug. It' s more a task, but I will assume it as a bug at this point.
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.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list