Skip to content

Conversation

@evnchn
Copy link
Collaborator

@evnchn evnchn commented Feb 2, 2026

Motivation

Fixes #5443, where when ConnectionResetError occurs (particularly with multiple videos in native mode on Windows), the server may hang indefinitely, unresponsive to Ctrl+C termination.

Additional debugging context in #5700's comments.

Implementation

By setting timeout_graceful_shutdown (default 10 seconds, which is plenty long, considering Redis also times out in 10 seconds), the server will forcefully terminate requests after this timeout elapses, ensuring the application exits rather than hanging.

Progress

  • I chose a meaningful title that completes the sentence: "If applied, this PR will..."
  • The implementation is complete.
  • If this PR addresses a security issue, it has been coordinated via the security advisory process.
  • Pytests have been added (or are not necessary).
  • Documentation has been added (or is not necessary).

Final notes

It appears that ConnectionResetError is inevitable on Windows. Nevertheless I think this PR is also good to ensure a bounded-wait termination (surprised it isn't originally the case tbh)

CC @python-and-novella

At this point we can consider to cherry-pick:

When ConnectionResetError occurs (particularly with multiple videos in
native mode on Windows), the server may hang indefinitely. By setting
timeout_graceful_shutdown (default 10 seconds), the server will
forcefully terminate requests after this timeout elapses, ensuring
the application exits rather than hanging.

Fixes zauberzeug#5443

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@falkoschindler falkoschindler added the bug Type/scope: Incorrect behavior in existing functionality label Feb 2, 2026
@falkoschindler falkoschindler added this to the 3.x milestone Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Type/scope: Incorrect behavior in existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ConnectionResetError from loading too many video elements in native browser

2 participants