-
Notifications
You must be signed in to change notification settings - Fork 486
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
change signal to SIG_DFL after exit_gracefully #3466
Conversation
Reviewer's Guide by SourceryThis pull request addresses an issue where multiple instances of the File-Level Changes
Tips
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @zrr1999 - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
signal.signal(signal.SIGINT, signal.SIG_DFL) | ||
signal.signal(signal.SIGTERM, signal.SIG_DFL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (bug_risk): Potential race condition with signal handling.
Reverting the signal handlers to their default behavior within exit_gracefully
might introduce a race condition if another signal is received before the program exits. Consider ensuring that the program exits immediately after setting the default handlers.
…ies to `Window` and `BrowserContextMenu` classes (#3463) * initial commit * commit * update Window * create BrowserContextMenu class * chore: remove deprecation_warning and reformat deprecated * change signal to SIG_DFL after exit_gracefully (#3466) * improve type hint for run_task and run_thread (#3459) * add type hint * fix Future[RetT] * feat(map): add missing py-events, better typing (#3464) * initial commit * commit * update Window * create BrowserContextMenu class * chore: remove deprecation_warning and reformat deprecated * Geolocator: rename some classes and methods --------- Co-authored-by: Zhan Rongrui <[email protected]>
…ies to `Window` and `BrowserContextMenu` classes (flet-dev#3463) * initial commit * commit * update Window * create BrowserContextMenu class * chore: remove deprecation_warning and reformat deprecated * change signal to SIG_DFL after exit_gracefully (flet-dev#3466) * improve type hint for run_task and run_thread (flet-dev#3459) * add type hint * fix Future[RetT] * feat(map): add missing py-events, better typing (flet-dev#3464) * initial commit * commit * update Window * create BrowserContextMenu class * chore: remove deprecation_warning and reformat deprecated * Geolocator: rename some classes and methods --------- Co-authored-by: Zhan Rongrui <[email protected]>
Description
I want to create multiple windows in my program, so I ran multiple app_async functions. However, I found that when I ran multiple app_async functions, Ctrl+C could not terminate my program.
Modifying exit_gracefully to ensure that the default value of the signal is restored after execution seems to be a solution.
Test Code
Type of change
Checklist:
Screenshots (if applicable):
Additional details
Summary by Sourcery
This pull request addresses an issue where the program could not be terminated using Ctrl+C when running multiple app_async functions. The fix involves restoring the default signal handlers for SIGINT and SIGTERM after the exit_gracefully function is executed.