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

blorente
Copy link
Contributor

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.

@blorente blorente force-pushed the blorente/ignore-sigint-pythonrepl-under-pantsd branch from 7a9357e to fcf89a5 Compare June 20, 2019 14:55
@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
@blorente blorente deleted the blorente/ignore-sigint-pythonrepl-under-pantsd branch June 21, 2019 09:37
blorente added a commit to blorente/pants that referenced this pull request Jun 21, 2019
## 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.
blorente added a commit that referenced this pull request Sep 4, 2019
**Problem**
When a pants run under pantsd calls pants, it will also enable pantsd in the inner run. Since we don't allow parallel runs under pantsd, the inner run will block waiting for the outer run to complete, eventually timing out and crashing the whole run.
See #7881 for context.
The only real instance we've seen of this was entirely accidental.

**Solution**
Explicitly disable pantsd through an environment variable whenever we are serving a pailgun request.

**Result**
Inner runs under pantsd have the daemon turned off by default.
Fixes #7881 , Depends on #7890

Commits should be independently reviewable.
blorente added a commit that referenced this pull request Sep 4, 2019
**Problem**
When a pants run under pantsd calls pants, it will also enable pantsd in the inner run. Since we don't allow parallel runs under pantsd, the inner run will block waiting for the outer run to complete, eventually timing out and crashing the whole run.
See #7881 for context.
The only real instance we've seen of this was entirely accidental.

**Solution**
Explicitly disable pantsd through an environment variable whenever we are serving a pailgun request.

**Result**
Inner runs under pantsd have the daemon turned off by default.
Fixes #7881 , Depends on #7890

Commits should be independently reviewable.
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.

None yet

4 participants