Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
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
Prev Previous commit
cleanup _shutdown_timeout_handle on _fatal_error
  • Loading branch information
fafhrd91 committed Jun 10, 2017
commit 31d625a1ac8bb80d6257117e891d74ace8a34f05
4 changes: 4 additions & 0 deletions Lib/asyncio/sslproto.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,10 @@ def _fatal_error(self, exc, message='Fatal error on transport'):
self._transport._force_close(exc)
self._transport = None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also cleanup _shutdown_timeout_handle here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should fatal_error just call finalize?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that makes sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added cleanup code for _shutdown_timeout_handle, it is possible to get here while handle still active


if self._shutdown_timeout_handle is not None:
self._shutdown_timeout_handle.cancel()
self._shutdown_timeout_handle = None

def _finalize(self):
self._sslpipe = None

Expand Down
1 change: 1 addition & 0 deletions Lib/test/test_asyncio/test_sslproto.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def test_close_abort(self):
'transport': transport,
'protocol': ssl_proto}
)
self.assertIsNone(ssl_proto._shutdown_timeout_handle)

def test_close(self):
# From issue #bpo-29406
Expand Down