From cca4c46dd8cd72afedd9c5d024d47b4554f00c53 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 16 Jul 2010 08:25:32 +0000 Subject: SIGTTIN works after SIGWINCH In addition to SIGHUP, it should be possible to gradually bring workers back up (to avoid overloading the machine) when rolling back upgrades after SIGWINCH. Noticed-by: Lawrence Pit ref: http://mid.gmane.org/4C3F8C9F.2090903@gmail.com (cherry picked from commit f1d33c80dd6c5650f960f7087f4e08f809754d34) --- t/t0009-winch_ttin.sh | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100755 t/t0009-winch_ttin.sh (limited to 't') diff --git a/t/t0009-winch_ttin.sh b/t/t0009-winch_ttin.sh new file mode 100755 index 0000000..6e56e30 --- /dev/null +++ b/t/t0009-winch_ttin.sh @@ -0,0 +1,59 @@ +#!/bin/sh +. ./test-lib.sh +t_plan 8 "SIGTTIN succeeds after SIGWINCH" + +t_begin "setup and start" && { + unicorn_setup +cat >> $unicorn_config </dev/null + do + i=$(( $i + 1 )) + test $i -lt 600 || die "timed out" + sleep 1 + done +} + +t_begin "start one worker back up" && { + kill -TTIN $unicorn_pid +} + +t_begin "wait for new worker to start" && { + test 0 -eq $(cat $fifo) || die "worker.nr != 0" + new_worker_pid=$(curl -sSf http://$listen/) + test -n "$new_worker_pid" && kill -0 $new_worker_pid + test $orig_worker_pid -ne $new_worker_pid || \ + die "worker wasn't replaced" +} + +t_begin "killing succeeds" && { + kill $unicorn_pid +} + +t_begin "check stderr" && check_stderr + +dbgcat r_err + +t_done -- cgit v1.2.3-24-ge0c7