There are three loops in the Session process.
Upon disconnection, the byte processing loop can hang on an infinite timeout while the session mailbox is destroyed.
This is a symptom of a race condition in the disconnection process.
While the race condition should be fixed at the source, it is preferable to kill the middle loop if the other loops have terminated.
Add this snippet on the bottom loop's termination:
To investigate race condition: figure out what are the conditions for the third loop terminating without destroying the queue.
There are three loops in the Session process. Upon disconnection, the byte processing loop can hang on an infinite timeout while the session mailbox is destroyed. This is a symptom of a race condition in the disconnection process.
While the race condition should be fixed at the source, it is preferable to kill the middle loop if the other loops have terminated.
Add this snippet on the bottom loop's termination:
To investigate race condition: figure out what are the conditions for the third loop terminating without destroying the queue.