• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pantsbuild / pants / 35405
0%
main: 93%

Build:
Build:
LAST BUILD BRANCH: fix/immutable-inputs-revalidation
DEFAULT BRANCH: main
Ran 15 Sep 2020 12:24AM UTC
Jobs 1
Files 434
Run time 34s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
35405

push

travis-ci-com

web-flow
Signal handling fixes (#10758)

### Problem

Ideally, pants should exit promptly when a user hits Ctrl-C in the terminal, regardless of how it is configured to run or what it is running. cf. https://github.com/pantsbuild/pants/issues/10051 and other general observations made while using pants, there are still a few cases where pants does not respond quickly to a Ctrl-C and hangs or otherwise takes a while to quit. This commit is an attempt to fix these cases.

### Solution

In the `--debug` case, the problem turned out to be that we were explicitly disabling SIGINT handling in the case where pants was running an `InteractiveProcess`. For the non-pantsd case, this is desirable - we use the `InteractiveProcess` abstraction for `test --debug` and a few other cases where we legitimately want a pants subprocess to take over the terminal and do its own signal handling. But when pantsd is running, we don't want to explicitly disable SIGINT handling, because that means that pantsd will ignore a signal from its own client process. This commit solves the problem by adding a flag to `SignalHandler` to indicate whether this is a pantsd run, and doesn't ignore SIGINT if it is.

Some other instances of pants ignoring prompt signal handling are caused by rust code not heeding the Python interrupt state triggered by SIGINT, resulting in pants not quitting until execution returns to the Python main thread. This commit works around this by having the Python signal handling infrastructure set a flag on `ExceptionSink` once it has handled a signal that would cause pants to terminate. A python helper function is passed into the main execution loop in `scheduler.rs` that checks for the presence of this flag, and breaks the loop to terminate the engine if it finds that the flag is set. 

### Result

Ctrl-C should now work in the `test --debug` case with pantsd, and work in the `--no-pantsd` case when any kind of test is running. It still does seem to take more t... (continued)

38 of 38 new or added lines in 5 files covered. (100.0%)

0 of 29356 relevant lines covered (0.0%)

0.0 hits per line

Jobs
ID Job ID Ran Files Coverage
5 35405.5 (PANTS_CONFIG_FILES="${TRAVIS_BUILD_DIR}/pants.travis-ci.toml" PANTS_DYNAMIC_UI=false LC_ALL="en_US.UTF-8" AWS_BUCKET=ci-public.pantsbuild.org BOOTSTRAPPED_PEX_KEY_PREFIX=daily/${TRAVIS_BUILD_NUMBER}/${TRAVIS_BUILD_ID}/pants.pex NATIVE_ENGINE_SO_KEY_PREFIX=monthly/native_engine_so PYENV_PY27_VERSION=2.7.18 PYENV_PY36_VERSION=3.6.10 PYENV_PY37_VERSION=3.7.7 PYENV_PY38_VERSION=3.8.3 PYENV_ROOT_OSX=${HOME}/.pants_pyenv PYENV_ROOT="${PYENV_ROOT:-${PYENV_ROOT_OSX}}" PATH="${PYENV_ROOT}/shims:${PATH}" AWS_CLI_ROOT="${HOME}/.aws_cli" AWS_ACCESS_KEY_ID__TO_BE_REEXPORTED_ON_DEPLOYS=AKIAV6A6G7RQ2HFZ5KP7 AWS_SECRET_ACCESS_KEY=[secure] RUST_BACKTRACE="all" BOOTSTRAPPED_PEX_KEY_SUFFIX=py36.linux PANTS_REMOTE_CA_CERTS_PATH=/usr/lib/google-cloud-sdk/lib/third_party/grpc/_cython/_credentials/roots.pem CACHE_NAME=python_tests.py36) 15 Sep 2020 12:24AM UTC 0
0.0
Travis Job 35405.5
Source Files on build 35405
Detailed source file information is not available for this build.
  • Back to Repo
  • Build #35405
  • bfd65d83 on github
  • Prev Build on master (#35401)
  • Next Build on master (#35410)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc