Sometines when you shutdown the server it all goes nice and smooth, but sometimes it doesn't.
There are three processes running: main stomp client, listener and parser.
The data flows like this: stomp client -> parser -> listener.
the parser has a queue from which it takes one message at a time, parses it, and puts it into the listener queue.
The queues block when they are empty to wait for a message, and that's the problem. Nothing signals the empty queue to unblock when the close signal was sent, so the clean disconnect only happens when there are unprocessed messages.
When there are unprocessed messages, the queue does not block and the quit variable gets read.
A simple solution would be a dummy/None message sent over to the queues when the processes are about to quit to avoid the deadlock.
Sometines when you shutdown the server it all goes nice and smooth, but sometimes it doesn't.
There are three processes running: main stomp client, listener and parser.
The data flows like this: stomp client -> parser -> listener.
the parser has a queue from which it takes one message at a time, parses it, and puts it into the listener queue.
The queues block when they are empty to wait for a message, and that's the problem. Nothing signals the empty queue to unblock when the close signal was sent, so the clean disconnect only happens when there are unprocessed messages.
When there are unprocessed messages, the queue does not block and the quit variable gets read.
A simple solution would be a dummy/None message sent over to the queues when the processes are about to quit to avoid the deadlock.