Skip to content
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

Fix for Bug #313: Ensure Graceful Interruption of Benchmark Process #325

Merged
merged 2 commits into from
Mar 15, 2024

Conversation

hvaria
Copy link
Contributor

@hvaria hvaria commented Mar 15, 2024

This pull request addresses bug #313, where users were unable to interrupt the benchmarking process using Ctrl+C, leading to a scenario where the benchmark would continue running indefinitely, ignoring interruption requests. The core of the issue was the absence of a proper signal handling mechanism for keyboard interrupts during the execution of the benchmarking commands.

Added a try-except block around the benchmarking execution commands in benchmark.py. This ensures that a KeyboardInterrupt (e.g., through Ctrl+C) is caught, and a graceful shutdown sequence can be initiated. Upon catching a KeyboardInterrupt, the script now calls stop_inference_containers() from container_adapter.py. This function halts all running inference containers, ensuring that no orphaned resources are left consuming system resources post-interruption.

Enhanced stop_inference_containers() to handle both interactive and automated environments gracefully.

Fix #313

…rocess

This pull request addresses bug roboflow#313, where users were unable to interrupt the benchmarking process using Ctrl+C, leading to a scenario where the benchmark would continue running indefinitely, ignoring interruption requests. The core of the issue was the absence of a proper signal handling mechanism for keyboard interrupts during the execution of the benchmarking commands.

Added a try-except block around the benchmarking execution commands in benchmark.py. This ensures that a KeyboardInterrupt (e.g., through Ctrl+C) is caught, and a graceful shutdown sequence can be initiated.
Upon catching a KeyboardInterrupt, the script now calls stop_inference_containers() from container_adapter.py. This function halts all running inference containers, ensuring that no orphaned resources are left consuming system resources post-interruption.

Enhanced stop_inference_containers() to handle both interactive and automated environments gracefully.
@PawelPeczek-Roboflow
Copy link
Collaborator

Hi @hvaria,
Thanks for the contribution 🏅 I will take a review early next week.

Copy link
Contributor

@yeldarby yeldarby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested it out locally & works well! Thanks for the contribution.

@yeldarby yeldarby merged commit 0fd8154 into roboflow:main Mar 15, 2024
22 of 23 checks passed
@hvaria
Copy link
Contributor Author

hvaria commented Mar 15, 2024

Your welcome guys! happy to contribute

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ctrl+C Doesn't Exit Benchmark
3 participants