Open preetapan opened 6 years ago
Tagging this to 1.0 for triage. I'm thinking we don't make any more changes for this at the current time, and that we kick this forward to look deeper and to add a wider set of signals we forward for non-Windows platforms.
Expanding to more signals is captured on https://github.com/hashicorp/consul/issues/3571.
Taking this off 1.0 - we should tackle this along with #3571.
We cleaned this up in #2999. When
consul watch
commands are run with a handler script, the handler script is a child of the parentconsul watch
process. However, sending -KILL/-INT to the parent doesn't seem to forward it to the child reliabily. After trying this a number of times, I only saw it successfully forward it once.Reproduction steps:
1) Bash script that traps signals:
2) Run consul watch:
consul watch -type key -key test ./test.sh
3) send INT or KILL to the consul watch pid, it doesn't cause test.sh to exit. test.sh still shows up in ps output.
Sending INT or KILL to test.sh's PID works as expected and terminates the script.
Seems like there is a narrow window in which we forward this and that races with the
consul watch
process processing the INT/KILL and stopping itself.