cshannon commented on PR #1641:
URL: https://github.com/apache/activemq/pull/1641#issuecomment-3823774532

   I looked at the test and I think I know what is going on but still would 
need to do some more work to prove it.
   
   The test sends the consumer info for the second consumer (consumer on real 
topic) to generate the advisory, and then immediately sends the consumer info 
for the first consumer (consumer on the advisory topic) so it can receive the 
advisory and get a replay. I believe the issue is that the advisory consumer 
may receive a duplicate of the consumer coming because it is getting both the 
"live" advisory and also a "replay" of the advisories because the second 
consumer is still in flight and being processed as coming online at the same 
time the advisor consumer is coming online. I'm not quite sure of the order but 
it seems like that is what is going on where it's just getting 2 copies as the 
logic for processing the new advisory consumer hasn't quite finished.
   
   When I run the test in a loop in Intellij it usually fails after a few 
thousand times. If I put in a 10 millisecond sleep immediately after 
[this](https://github.com/apache/activemq/blob/main/activemq-unit-tests/src/test/java/org/apache/activemq/broker/advisory/AdvisoryBrokerTest.java#L155)
 line to give the real consumer time to fully come online (which is the goal, 
so we can test replay) before bringing the advisory consumer online then the 
test no longer fails.
   
   I'm not sure there's much to do here to fix it other than fix the test, it 
would be hard to prevent issues in all cases without deadlocks. A duplicate 
consumer advisory isn't really a big deal as the consumer id is the same so the 
advisory just gets notified twice but it's the same id so I would expect 
processes listening to the advisories (like network bridges) to be able to 
handle it without issue.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to