I have added sidekiqctl stop in preStop hook of deployment template, to gracefully shutdown sidekiq process running in pod on Devtron.
Script that I’m trying to execute in preStop hook
echo "Stopping sidekiq..."
for pid in $SIDEKIQ_PIDS/*.pid; do
echo "Stopping specific pid..."
bundle exec sidekiqctl stop $pid 30
echo "removing pid file"
rm -rf $pid
done
echo "done"
Expected behaviour:
Sidekiq process should gracefully shutdown and all the echo statement should be printed
Actual behaviour:
it’s running fine till sidekiqctl stop command. I have the checked the pod logs, sidekiq shutdown logs are getting captured but no further echo command are getting executing that leads to preStopFailed event.
Pod logs:
Note:
Have tried various method to capture the sidekiqctl stop commands output like running it in background then waiting for that that process to compelete and Also tried by increasing the graceTimeout and sidekiqctl command timeout still the same issue.