-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #95: Race condition during shutdown observed
At least I assume it closes this race condition. The shutdown process sets the runflag to false, and then, if we're in consumer.receive(), close the JMS Session - "from the outside" of the actual processing thread. "On the inside", we check whether the received message is null. However, we can just be on our way out of consumer.receive() with a brand new message, and *then* the runflag is set to false and JMS Session is closed. Thus, the previous logic would not catch that, and start processing the message, but fail when trying to commit the now-closed JMS Session. The new logic instead directly checks the runFlag, and bails if it is false even though we have a message. We close the session, ensuring that the message reception is rolled back, and exit. Lots of comments in code, so feel free to read up!
- Loading branch information
Showing
1 changed file
with
56 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters