Skip to content

Commit

Permalink
address potential lock of the service thread
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Oct 9, 2018
1 parent 2f5cd48 commit b702f6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions engineio/asyncio_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,8 @@ async def _service_task(self): # pragma: no cover
try:
# iterate over the current clients
for socket in self.sockets.copy().values():
if socket.closed:
continue
await socket.check_ping_timeout()
if not socket.closing and not socket.closed:
await socket.check_ping_timeout()
await self.sleep(sleep_interval)
except:
# an unexpected exception has occurred, log it and continue
Expand Down
5 changes: 2 additions & 3 deletions engineio/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,9 +524,8 @@ def _service_task(self): # pragma: no cover
try:
# iterate over the current clients
for s in self.sockets.copy().values():
if s.closed:
continue
s.check_ping_timeout()
if not s.closing and not s.closed:
s.check_ping_timeout()
self.sleep(sleep_interval)
except (SystemExit, KeyboardInterrupt):
break
Expand Down

0 comments on commit b702f6f

Please sign in to comment.