Visitar URL original
t.sh: better Ctrl-C handling by jsha · Pull Request #9131 · letsencrypt/boulder · GitHub
Skip to content

t.sh: better Ctrl-C handling - #9131

Open
jsha wants to merge 2 commits into
mainfrom
ctrl-c
Open

jsha wants to merge 2 commits into
mainfrom
ctrl-c

Conversation

@jsha

@jsha jsha commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

With docker run, the Docker process receives Ctrl-C and forwards it to the container's PID 1 (which is commonly test.sh). Often this results in no or slow response during integration tests (when test.sh has a child Python process).

With docker run -it, the Docker process creates a pseudo-tty. When the user types Ctrl-C, that goes through the pseudo-tty and is received by the whole "foreground process group", in other words both bash and Python. This results in faster shutdown on Ctrl-C.

https://docs.docker.com/reference/cli/docker/container/run/#interactive https://docs.docker.com/reference/cli/docker/container/run/#tty

https://www.gnu.org/software/bash/manual/html_node/Job-Control-Basics.html#Job-Control-Basics-1 https://stackoverflow.com/a/41099052

With `docker run`, the Docker process receives Ctrl-C and forwards it to the
container's PID 1 (which is commonly `test.sh`). Often this results in no or
slow response during integration tests (when `test.sh` has a child Python
process).

With `docker run -it`, the Docker process creates a pseudo-tty. When the user
types Ctrl-C, that goes through the pseudo-tty and is received by the whole
"foreground process group", in other words both bash and Python. This results
in faster shutdown on Ctrl-C.

https://docs.docker.com/reference/cli/docker/container/run/#interactive
https://docs.docker.com/reference/cli/docker/container/run/#tty

https://www.gnu.org/software/bash/manual/html_node/Job-Control-Basics.html#Job-Control-Basics-1
https://stackoverflow.com/a/41099052
@jsha
jsha requested a review from a team as a code owner October 28, 2026 17:06
@jsha
jsha requested a review from aarongable October 28, 2026 17:06
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.

1 participant