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
The sent_close_time in WebSocket.State is an absolute epoch time (see line 240). But Session._check_close_timeout() performs a comparison which is based on elapsed seconds relative to the start of the session (see line 262), thus the close timeout will never fire. A simple fix would be to store "elapsed session time" in sent_close_time.
On a related note, it is a bit counter-intuitive to me that every call to WebSocket.close() updates the sent_close_time. Thus, for a case where multiple close packets happen to be sent, the close timeout check is always relative to the last packet rather than the first. If one is relying on the close timeout check to close out a session where the server fails to respond, and there is a programming error where close() is being called periodically in a loop, then the timeout will likely never succeed.
The text was updated successfully, but these errors were encountered:
The
sent_close_time
inWebSocket.State
is an absolute epoch time (see line 240). ButSession._check_close_timeout()
performs a comparison which is based on elapsed seconds relative to the start of the session (see line 262), thus the close timeout will never fire. A simple fix would be to store "elapsed session time" insent_close_time
.On a related note, it is a bit counter-intuitive to me that every call to
WebSocket.close()
updates thesent_close_time
. Thus, for a case where multiple close packets happen to be sent, the close timeout check is always relative to the last packet rather than the first. If one is relying on the close timeout check to close out a session where the server fails to respond, and there is a programming error whereclose()
is being called periodically in a loop, then the timeout will likely never succeed.The text was updated successfully, but these errors were encountered: