10000 Fixed race condition with on_open and session.close() · pythonanywhere/tornadio2@9b9d4a4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9b9d4a4

Browse files
committed
Fixed race condition with on_open and session.close()
1 parent 04705be commit 9b9d4a4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tornadio2/session.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,6 @@ def __init__(self, conn, server, request, expiry=None):
107107
# If everything is fine - continue
108108
self.send_message(proto.connect())
109109

110-
result = self.conn.on_open(info)
111-
if result is not None and not result:
112-
raise HTTPError(401)
113-
114110
# Heartbeat related stuff
115111
self._heartbeat_timer = None
116112
self._heartbeat_interval = self.server.settings['heartbeat_interval'] * 1000
@@ -119,6 +115,10 @@ def __init__(self, conn, server, request, expiry=None):
119115
# Endpoints
120116
self.endpoints = dict()
121117

118+
result = self.conn.on_open(info)
119+
if result is not None and not result:
120+
raise HTTPError(401)
121+
122122
# Session callbacks
123123
def on_delete(self, forced):
124124
"""Session expiration callback

0 commit comments

Comments
 (0)
0