79a7c157a3
Motivation: Consider a scenario when the client iniitiates a WebSocket handshake but before the handshake is complete, the channel is closed due to some reason. In such scenario, the handshake timeout scheduled on the executor is not cleared. The reason it is not cleared is because in such cases the handshakePromise is not completed. Modifications: This change completes the handshakePromise exceptinoally on channelInactive callback, if it has not been completed so far. This triggers the callback on completion of the promise which clears the timeout scheduled on the executor. This PR also adds a test case which reproduces the scenario described above. The test case fails before the fix is added and succeeds when the fix is applied. Result: After this change, the timeout scheduled on the executor will be cleared, thus freeing up thread resources. |
||
---|---|---|
.. | ||
src | ||
pom.xml |