Skip to content

Conversation

@elprans
Copy link
Member

@elprans elprans commented Mar 29, 2017

Use asyncio.shield() to guarantee that task cancellation
does not prevent the connection from being returned to the
pool properly.

Fixes: #97.

@elprans elprans requested a review from 1st1 March 29, 2017 15:20
@elprans elprans self-assigned this Mar 29, 2017
asyncpg/pool.py Outdated
# Use asyncio.shield() to guarantee that task cancellation
# does not prevent the connection from being returned to the
# pool properly.
return await asyncio.shield(self._release_impl(connection))
Copy link
Member

Choose a reason for hiding this comment

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

Please pass the loop arg explicitly.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Use asyncio.shield() to guarantee that task cancellation does not prevent the connection from being returned to the pool properly. Fixes: #97.
@elprans elprans force-pushed the pool-release-cancellation branch from b7ab545 to 29620c1 Compare March 29, 2017 15:40
@elprans elprans merged commit 537c8c9 into master Mar 29, 2017
@elprans elprans deleted the pool-release-cancellation branch March 29, 2017 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants