-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[py] Use daemon threads for WebSocket connections #16298
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
base: trunk
Are you sure you want to change the base?
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
User description
🔗 Related Issues
Fixes #16294
💥 What does this PR do?
This PR makes the threads used for WebSockets into "daemon threads". This probably doesn't make much practical difference, but it will alleviate an annoying condition where you just want to exit a program, but for some reason the WebSocket connection or callback is hanging.
With the
daemon
flag, all threads will be abruptly killed on interpreter shutdown.See: #16294 for more information
🔄 Types of changes
PR Type
Bug fix
Description
Convert WebSocket threads to daemon threads for proper shutdown
Prevents hanging threads from blocking interpreter exit
Applies to both main WebSocket connection and callback threads
Diagram Walkthrough
File Walkthrough
websocket_connection.py
Convert WebSocket threads to daemon threads
py/selenium/webdriver/remote/websocket_connection.py
daemon=True
parameter to main WebSocket thread creationdaemon=True
parameter to callback thread creation