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: interruption signal not terminating the process when spamming <C-c> #478

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

teocns
Copy link

@teocns teocns commented Oct 31, 2024

Fixes #477

@@ -318,6 +318,8 @@ def cleanup(end_state: str = "Fail", end_state_reason: Optional[str] = None):
end_state_reason=end_state_reason,
)

__handled = False
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor nit: rename to __signal_handled

@teocns
Copy link
Author

teocns commented Nov 1, 2024

After further consideration, addressing this at the root is essential. While this fix works, it only addresses the surface issue.

Looking at the Session implementation everything made more sense; threading components are being used, indicating that somewhere the Session state is left in an inconsistent state, specifically and presumably happening as Control+C will initiate re-entry into a circuit whose state was left "open"; this is very common side effects caused by improper threading.Lock implementation, like in this case.

…sing atexit and signal

refactor(session.py): streamline end_session logic to improve readability and maintainability
@areibman
Copy link
Contributor

areibman commented Nov 1, 2024

Cool fix. I've had this issue a number of times but hard to replicate and pin down when/why. A test script that's able to replicate + show the fix would be much appreciated

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.

[Bug]: inconsistent SIGINT behavior
2 participants