Bug 972444 - Concurrent calling of QueueImpl.deliver() results in duplicated messages
Concurrent calling of QueueImpl.deliver() results in duplicated messages
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: HornetQ (Show other bugs)
6.1.0
All All
high Severity high
: ER7
: EAP 6.1.1
Assigned To: Clebert Suconic
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-09 08:52 EDT by Yong Hao Gao
Modified: 2013-09-16 16:30 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-16 16:30:48 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker HORNETQ-1224 Major Closed Concurrent calling of QueueImpl.deliver() results in duplicated messages 2015-11-25 06:12 EST

  None (edit)
Description Yong Hao Gao 2013-06-09 08:52:25 EDT
Description of problem:

In QueueImpl, when paging involved, the deliver() method maybe concurrent called by different executors (the one in the queue and the one from page subscription). Although either of them is ordered executors, they schedule tasks independently of each other. So there is a chance when both executors are used, each has a thread calling deliver(). This may lead to the message acknowledgement on a consumer out of order and the message delivered more than once.

Version-Release number of selected component (if applicable):


How reproducible:

Run the tests attached to the forum


Actual results:
test failure with many duplicated messages

Expected results:
test pass

Additional info:
Comment 1 JBoss JIRA Server 2013-06-11 05:35:00 EDT
Francisco Borges <francisco.borges@redhat.com> made a comment on jira HORNETQ-1224

Hi Howard, I commented on the case on the forum. If we synchronize {{QueueImpl.deliver()}} on a {{deliveryGuard}}, the tests will pass (and actually run much faster). Something like this ought to fix the case:

{code}
  private final Object deliveryGuard = new Object();

  private void deliver()
   {
      synchronized (deliveryGuard)
      {
        // ....
      }
   }
 {code}

Since you are out on vacation and we are not releasing a new version tomorrow, I'm not sending a PR on this as the fix is yours.
Comment 2 JBoss JIRA Server 2013-06-13 04:34:56 EDT
Yong Hao Gao <hgao@redhat.com> made a comment on jira HORNETQ-1224

Hi Francisco,

As discussed I assigned this task to you. :)

Thanks.
Comment 3 JBoss JIRA Server 2013-06-14 08:42:51 EDT
Francisco Borges <francisco.borges@redhat.com> updated the status of jira HORNETQ-1224 to Resolved
Comment 4 JBoss JIRA Server 2013-06-14 08:42:51 EDT
Francisco Borges <francisco.borges@redhat.com> made a comment on jira HORNETQ-1224

Fix + unit test are merged. Case is fixed.
Comment 5 JBoss JIRA Server 2013-06-20 16:37:47 EDT
Clebert Suconic <clebert.suconic@jboss.com> updated the status of jira HORNETQ-1224 to Closed
Comment 7 Miroslav Novak 2013-08-22 07:29:51 EDT
BZ is in incorrect state. Fix for this issue is present in EAP 6.1.1.ER7(HQ 2.3.5.Final) 

Verified using provided test in EAP 6.1.1.ER7.

Note You need to log in before you can comment on or make changes to this bug.