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

Fix asyncio SSL unclosed warning #210

Merged
merged 2 commits into from
Aug 6, 2021
Merged

Conversation

fantix
Copy link
Member

@fantix fantix commented Aug 6, 2021

@fantix fantix requested a review from 1st1 August 6, 2021 00:57
@fantix fantix merged commit d718839 into edgedb:master Aug 6, 2021
@fantix fantix deleted the fix-unclosed-warning branch August 6, 2021 02:45
# properly, leading to false ResourceWarning. Let's fix that by
# closing the transport again.
if not self._transport.is_closing():
self._transport.close()
Copy link
Member

Choose a reason for hiding this comment

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

Should this be copied to terminate()?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think _AsyncIOConnectionImpl.terminate() is fine, because it calls AsyncIOProtocol.abort() which closes the transport.

Copy link
Member Author

Choose a reason for hiding this comment

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

But maybe moving this logic to AsyncIOProtocol.connection_lost() is a better idea - so that the transport is always marked as closed as far as connection_lost() is called.

elprans added a commit that referenced this pull request Aug 7, 2021
Fixes
=====

* Fix failing tests regarding --help (#207)
  (by @fantix in 956a2ca for #207)

* Fix confusing error when no arguments are passed to a query with named params (#208)
  (by @elprans in 8e0b334 for #208)

* Add Python 3.10 compatibility (#209)
  (by @elprans in 3472f17 for #209)

* Fix asyncio SSL unclosed warning (#210)
  (by @fantix in d718839 for #210)

* More reliable transport double-closing
  (by @fantix in 337b779)

* Rename `query_one` to `query_single`
  (by @fmoor in f6900b0)
@elprans elprans mentioned this pull request Aug 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants