Browse Source

Wait 20 secs for sockets to close

10 seems a little low
master
Neil Booth 8 years ago
parent
commit
ccf24fdc71
  1. 6
      server/protocol.py

6
server/protocol.py

@ -326,17 +326,17 @@ class ServerManager(LoggedClass):
await asyncio.sleep(0)
self.servers = []
self.logger.info('server listening sockets closed')
limit = time.time() + 10
limit = time.time() + 15
while self.sessions and time.time() < limit:
self.logger.info('{:,d} sessions remaining'
.format(len(self.sessions)))
await asyncio.sleep(2)
await asyncio.sleep(3)
if self.sessions:
self.logger.info('forcibly closing {:,d} stragglers'
.format(len(self.sessions)))
for future in self.sessions.values():
future.cancel()
await asyncio.sleep(0)
await asyncio.sleep(1)
def add_session(self, session):
assert self.servers

Loading…
Cancel
Save