init script restart loses sidekiq
Created by: jaypea
I'm running the 6-0-stable branch and discovered an issue with the init script
whenever i call service gitlab restart or stop and start shortly after one another, the sidekiq service is not coming back.
the reason is the usage of & in the call to execute "mkdir -p $PID_PATH && $START_SIDEKIQ > /dev/null 2>&1 &"
this sends both the start and stop rake tasks in background. the stop task takes a while to finish its job. in the meanwhile the start task already finished, maybe because it found the already running process which has not been stopped yet.
solution would be to wait for the stop task to complete before executing the start task.
steps to reproduce:
-
ps ax|grep kiq|grep -v grepshould return something to begin with service gitlab restart-
ps ax|grep kiq|grep -v grepnow shows several entries - wait 1-2 minutes
-
ps ax|grep kiq|grep -v grephas an empty result