Skip to content

Conversation

@DarshiniKurasa
Copy link

Summary

This PR improves deployment reliability by stopping Supervisor from restarting unrelated processes.
Replaces the global supervisorctl reload handler with a targeted restart of the WireGuard VPN updater supervisor process to avoid unnecessary restarts of unrelated services.

What was changed

  • Added a new handler in handlers/main.yml:
    • Runs: supervisorctl restart openwisp-flask-vpn-updater-{{ openwisp2_wireguard_vpn_uuid }}
    • Uses register, failed_when, and changed_when logic so:
      • The play does not fail if the process doesn't exist
      • The task reports changed only when a restart succeeds
  • Updated notify statements in tasks to use the new handler:
    • tasks/flask.yml
    • tasks/pip.yml
    • tasks/uwsgi.yml
  • Kept verify.yml unchanged to avoid altering test behavior unnecessarily

Why

Reloading supervisor triggers a restart of all managed processes, creating avoidable downtime.
Restarting only the affected process is safer, more efficient, and aligns with the request in issue #47.

How to verify

Run local QA checks:

run-qa-checks

(Already tested locally, passed successfully)

Closes #47

Happy to update the PR if needed. Thanks for reviewing!

Replace supervisorctl reload with a targeted restart of
openwisp-flask-vpn-updater-{{ openwisp2_wireguard_vpn_uuid }} and add safe
register/failed_when/changed_when logic to avoid failing when the process
is absent. Update task notifications accordingly.

Fixes : openwisp#47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[change] Instead of reloading supervisor after changes, restart only the affected process

1 participant