Skip to content

Commit

Permalink
Send SIGTERM repeatedly to terminate trillian processes
Browse files Browse the repository at this point in the history
Repeated kill is a workaround that can most likely be reverted once
google/trillian#2805 makes into into a
trillian release.

Uses SIGTERM rather than SIGINT, because (i) SIGTERM (the default kill
signal) seems more appropriate for scripted usage, while SIGINT is for
interactive usage, e.g., pressing Control-C in the terminal, and (ii)
SIGINT didn't work in my local tests.
  • Loading branch information
Niels Möller committed Sep 9, 2022
1 parent b3ab1cd commit 53b3ac8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions integration/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,19 @@ function node_stop_fe() {

function node_stop_be() {
for i in $@; do
pp ${nvars[$i:tsrv_pid]} && kill -2 ${nvars[$i:tsrv_pid]}
pp ${nvars[$i:tsrv_pid]} && kill ${nvars[$i:tsrv_pid]}
while :; do
sleep 1

pp ${nvars[$i:tsrv_pid]} && continue
# The Trillian log server doesn't exit
# properly on first SIGTERM, so we repeat it,
# rather than just waiting for the process to
# shut down.
if pp ${nvars[$i:tsrv_pid]}; then
info "Resending SIGTERM to process ${nvars[$i:tsrv_pid]}"
kill ${nvars[$i:tsrv_pid]}
continue
fi

break
done
Expand Down

0 comments on commit 53b3ac8

Please sign in to comment.