This is causing me to experience timeouts when stopping the application. I currently have a single listener with a check_interval set to 10. I am able to reproduce this with the following method:
root@i-ef5077bc:~# for i in seq{1..10}; do (sv stop nerve > /dev/null && sv start nerve > /dev/null ) ; echo status is $?; sleep 1; done
status is 0
status is 1
status is 0
status is 1
status is 0
status is 1
status is 0
status is 1
status is 0
status is 1
root@i-ef5077bc:/opt/smartstack/nerve/src# for i in seq{1..10}; do (sv stop nerve > /dev/null && sv start nerve > /dev/null ) ; echo status is
$?; sleep 1; done
status is 0
status is 0
status is 0
status is 0
status is 0
status is 0
status is 0
status is 0
status is 0
status is 0
I am noticing that the service_watcher sleep loop is not configured to check for $EXIT during long sleep loops, as per: https://github.com/airbnb/nerve/blob/master/lib/nerve/service_watcher.rb#L72
This is causing me to experience timeouts when stopping the application. I currently have a single listener with a check_interval set to 10. I am able to reproduce this with the following method:
This patch in this PR fixes the issue for me: https://github.com/airbnb/nerve/pull/53