FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Prevent stuck cancel requests from blocking close by aryansk · Pull Request #1349 · MagicStack/asyncpg · GitHub

Prevent stuck cancel requests from blocking close - #1349

Draft
aryansk wants to merge 1 commit into
MagicStack:masterfrom
aryansk:fix/1326-close-cancel-task
Draft

Prevent stuck cancel requests from blocking close#1349
aryansk wants to merge 1 commit into
MagicStack:masterfrom
aryansk:fix/1326-close-cancel-task

Conversation

aryansk commented Aug 16, 2026

Copy link
Copy Markdown

Summary

Prevent an in-flight PostgreSQL CancelRequest task from keeping Connection.close(timeout=...) alive beyond the requested graceful-close timeout.

Changes

  • cancel outstanding background cancellation tasks before beginning the graceful protocol close
  • rely on the existing cancellation-task cleanup path to discard those tasks and resolve their waiters
  • leave normal connection close behavior unchanged when no cancellation is pending

Test plan

Use the self-contained fake-server reproducer from #1326: after a command timeout creates a held-open cancel connection, conn.close(timeout=2) should no longer wait indefinitely.

Fixes #1326

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant


Back | FazBrowse Home | New Git URL