habitat-sh / habitat

Modern applications with built-in automation
https://www.habitat.sh
Apache License 2.0
2.59k stars 315 forks source link

Run reconfigure hook asynchronously #5958

Open christophermaier opened 5 years ago

jsirex commented 5 years ago

Use-case: In reload hook I can decide what to do with a service. If reload is possible I write something:

kill -USR2 $(cat {{pkg.svc_pid_file}})

But if I want to restart service on config change and reload hook exists I have to write:


if [ "$some_condition" == "true" ]; then
  echo "Going restart instead of reload ..."
  kill $(cat {{pkg.svc_pid_file}})
fi

Expected supervisors' behavior on config change:

  1. run reload hook (which might or might not kill main process)
  2. run reconfigure hook in background
  3. recover service by re-run run hook if main process died

Actual supervisors' behavior on config change:

  1. run reload hook
  2. run reconfigure hook in foreground blocking any other activities (probably load/unload affected here too)
  3. recover service by re-run run hook only after reconfigure hook exit

This prevents from implementing many service packages with habitat.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you.

stale[bot] commented 1 year ago

This issue has been automatically closed after being stale for 400 days. We still value your input and contribution. Please re-open the issue if desired and leave a comment with details.