You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Client's received handler sends a tcp message with connection.sendTCP()
[Thread 2]
3. Client.stop() is called, and calls Client.close()
4. Client.close() closes the tcp connection
5. Client.close() grabs updateLock
6. Client.close() calls selector.selectNow(), and waits for [Thread 1] to unlock selector
[Thread 1]
6. Cause tcp connection is closed, Client.sendTCP() throws an IOException and calls Client.close()
7. Client.close() waits for [Thread 2] to unlock updateLock
The text was updated successfully, but these errors were encountered:
This scenario occured during execution of the JsonTest, but I'm pretty sure it is also possible in a real enviroment.
To understand this problem, it is important to know, that Selector.selectNow() synchronizes on Selector, Selector.keys() and Selector.selectedKeys().
[Thread 1]
Client.update()
locksselector
connection.sendTCP()
[Thread 2]
3.
Client.stop()
is called, and callsClient.close()
4.
Client.close()
closes the tcp connection5.
Client.close()
grabsupdateLock
6.
Client.close()
callsselector.selectNow()
, and waits for [Thread 1] to unlockselector
[Thread 1]
6. Cause tcp connection is closed,
Client.sendTCP()
throws an IOException and callsClient.close()
7.
Client.close()
waits for [Thread 2] to unlockupdateLock
The text was updated successfully, but these errors were encountered: