Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove heartbeat on closing connection on keepalive timeout #3041

Merged
merged 2 commits into from
Jun 1, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Remove heartbeat on closing connection on keepalive timeout
  • Loading branch information
asvetlov committed May 31, 2018
commit 9cf871e79365e0a17bb7829fea81649dfb88830e
6 changes: 2 additions & 4 deletions aiohttp/web_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,14 +286,12 @@ def close(self):
if self._waiter:
self._waiter.cancel()

def force_close(self, send_last_heartbeat=False):
def force_close(self):
"""Force close connection"""
self._force_close = True
if self._waiter:
self._waiter.cancel()
if self.transport is not None:
if send_last_heartbeat:
self.transport.write(b"\r\n")
self.transport.close()
self.transport = None

Expand All @@ -317,7 +315,7 @@ def _process_keepalive(self):
# handler in idle state
if self._waiter:
if self._loop.time() > next:
self.force_close(send_last_heartbeat=True)
self.force_close()
return

# not all request handlers are done,
Expand Down