Improved Ctrl + c behavior#1231
Conversation
|
Much needed as default is really slow! Should be merged. |
Yep definitely! Thanks for the PR! I'll look into this soon. |
|
Hi, so I looked a bit deeper into it. Basically this solution still does not really exit the child threads gracefully, but just immediately aborts everything with the call to Let's go forward with this for now, so we at least have a way forcefully shutdown everything without that we need to press Please also fix the Pull request description (remove the prefilled text like |
Description
In this version, we use os._exit(0) to stop execution. It is a "Hard Kill" that ends the process without waiting for the threads to finish
When using asyncio.run_in_executor, the main thread is not "working" on the scan, but rather is monitoring the event loop. This allows the CTRL+C signal to be processed instantly rather than waiting for a network socket to respond.
Type of change
Insert an "x" inside the brackets for relevant items (do not delete options)
Setup guide for the review
You can test it by scaning any /24 or segment on any protocol. Tested on Linux and Windows
Related: #61
Screenshots (if appropriate):
https://github.com/user-attachments/assets/1929d2ba-abd5-4b8c-810f-01fb23355a00
https://github.com/user-attachments/assets/bbf1fe46-6094-4461-84f7-3f0b7b5c796d
Checklist:
Insert an "x" inside the brackets for completed and relevant items (do not delete options)
poetry run ruff check ., use--fixto automatically fix what it can)tests/e2e_commands.txtfile if necessary (new modules or features are required to be added to the e2e tests)Note: There are other 2 issues when running ruff not related to my changes