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

Update python_repl to use ignoring_sigint to... ignore SIGINT #7890

Merged
merged 1 commit into from Jun 21, 2019

Conversation

Projects
None yet
4 participants
@blorente
Copy link
Contributor

commented Jun 18, 2019

Problem

After removing forking from pantsd, we introduced a new abstraction to ExceptionSink that allowed ignoring SIGINT without installing signal handlers (#7623).

This was necessary because no pants runs under pantsd run in a non-main thread, and therefore crash when you install signal handlers.

This PR makes use of that new functionality, to ignore SIGINT in python_repls

Solution

Instead of only ignoring sigint in the cases where we are not running from the daemon, ignore it every time using the new ExceptionSink.ignoring_sigint() contextmanager.

Result

Using Ctrl-C on a python repl is properly ignored and no longer crashes the daemon.

@ity

ity approved these changes Jun 18, 2019

@blorente blorente force-pushed the blorente/ignore-sigint-pythonrepl-under-pantsd branch from 7a9357e to fcf89a5 Jun 20, 2019

@blorente blorente changed the title Migrate python_repl to use ignoring_sigint to... ignore SIGINT Update python_repl to use ignoring_sigint to... ignore SIGINT Jun 20, 2019

@blorente blorente merged commit 07eb08e into master Jun 21, 2019

1 of 2 checks passed

continuous-integration/travis-ci/push The Travis CI build could not complete due to an error
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@blorente blorente deleted the blorente/ignore-sigint-pythonrepl-under-pantsd branch Jun 21, 2019

blorente added a commit to blorente/pants that referenced this pull request Jun 21, 2019

Migrate python_repl to use ignoring-sigint (pantsbuild#7890)
## Problem
After removing forking from pantsd, we introduced a new abstraction to ExceptionSink that allowed ignoring SIGINT without installing signal handlers (pantsbuild#7623).

This was necessary because no pants runs under pantsd run in a non-main thread, and therefore crash when you install signal handlers.

This PR makes use of that new functionality, to ignore SIGINT in python_repls

## Solution
Instead of only ignoring sigint in the cases where we are not running from the daemon, ignore it every time using the new ExceptionSink.ignoring_sigint() contextmanager.

## Result
Using Ctrl-C on a python repl is properly ignored and no longer crashes the daemon.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.