-
Notifications
You must be signed in to change notification settings - Fork 701
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
Cabal run leaves children running when killed #7914
Comments
I seem to remember an old ticket about that. |
I think in some sense the right/expected thing would be for |
Ah, yes, #7757 seems to address this issue explicitly. Thanks! I'd looked through issues but not PRs. |
I'm convinced this is a bug by now. cabal should stop and wait for all its children when killed. As a work-around, I'm using this shell script to replace #!/usr/bin/env bash
# cabal-run.sh target args
#
# is equivalent to
#
# cabal run target -- args
#
# except that killing it will also kill the target.
#
# https://github.com/haskell/cabal/issues/7914
set -euo pipefail
target="$1"
shift
echo "building target: ${target}"
cabal build "$target"
executable=$(cabal list-bin "$target")
exec "$executable" "$@" |
There's two major parts to this change: 1. cut down on environment variables needed to run the tests: - lux parameters that don't change are now in code - most remaining parameters have reasonable defaults - the only variable that is still required to be set is HASURA_MULTITENANT_SPEC_DB_URL - env.sh is no longer needed 2. find a better work-around for the problems running graphql-engine-multitenant via cabal run (haskell/cabal#7914), by adding a shell script that implements a more correct version of cabal run. PR-URL: hasura/graphql-engine-mono#3461 GitOrigin-RevId: 0939a79cc45cd3c1c103719552b12099678850dd
Describe the bug
When
cabal run
receivesSIGTERM
, it exits, but leaves its children running.I'm not entirely sure whether this is buggy behaviour, but I was surprised by this,
in the context of running a Haskell tool via
cabal run
andwithProcessTerm
.If I run
cabal run target
from the shell, and runkill <cabal-run-pid>
, I would have expected bothcabal
andtarget
to stop. Instead,
cabal
exits buttarget
keeps running.Note that when run interactively,
Ctrl-C
sendsSIGINT
to the wholeprocess group, which is how
cabal run
interrupts nicely onCtrl-C
.To Reproduce
Then call
cabal run x.hs
, in a different terminal:Then the child keeps running although
cabal
exits:Expected behavior
I'd like the child process to be killed, too.
System information
The text was updated successfully, but these errors were encountered: