Skip to content

fix: rename alerting role's Restart Tomcat handler to avoid collision - #111

Merged
tkipkurgat merged 1 commit into
mainfrom
fix/alerting-tomcat-handler-collision
Sep 30, 2026
Merged

tkipkurgat merged 1 commit into
mainfrom
fix/alerting-tomcat-handler-collision

Conversation

@tkipkurgat

Copy link
Copy Markdown
Collaborator

Summary

  • The alerting role (PR feat: co-located Alertmanager alerting hub #83) defines its own Restart Tomcat handler, identically named to create-instance's handler that restarts the DHIS2 instance's tomcat service after a war deploy.
  • Ansible resolves notify: by name across the whole play. On plain instance hosts where the alerting role's handler ends up gated/skipped, it silently shadows create-instance's own handler — the restart notification never reaches the handler that actually restarts tomcat.
  • Confirmed live: after a fresh deploy, Tomcat's own startup deploy-scan can catch the war extraction mid-write and fail to start the DHIS2 context (ClassNotFoundException). deploy-war.yml's notify/flush_handlers chain exists specifically to recover from this via a restart, but with the name collision RUNNING HANDLER [alerting : Restart Tomcat] shows skipping for the instance host, so the real restart never fires and the instance is left permanently serving 404.
  • Fix: renamed the alerting role's handler to Restart Tomcat (alerting) and updated its one caller (peer_glowroot.yml). create-instance's own handler and all of its notify references are untouched.

Test plan

  • ansible-playbook dhis2.yml --syntax-check passes
  • Verified live on the deployment server: reproduced the 404 on origin/main (RUNNING HANDLER [alerting : Restart Tomcat] skipping: [dhis], tomcat never restarted), applied this fix, redeployed — tomcat now restarts correctly and the instance comes up (confirmed working by Tito)

🤖 Generated with Claude Code

The alerting role (PR #83) defines its own "Restart Tomcat" handler,
identically named to create-instance's handler that actually restarts
the DHIS2 instance's tomcat service after a war deploy. Ansible resolves
notify: by name across the whole play, so on hosts where the alerting
role's handler is gated skipped (e.g. plain instance hosts), it silently
shadows create-instance's own handler - the notification never reaches
the handler that would actually restart tomcat.

Confirmed live: after a fresh deploy, Tomcat's startup deploy-scan can
catch the war extraction mid-write and fail to start the DHIS2 context
(ClassNotFoundException), which the notify/flush_handlers chain in
deploy-war.yml is designed to recover from via a restart. With the name
collision, RUNNING HANDLER [alerting : Restart Tomcat] shows "skipping"
for the instance host and the real restart never fires, leaving the
instance permanently serving 404.

Renames the alerting role's handler to "Restart Tomcat (alerting)" and
updates its one caller (peer_glowroot.yml) to match. create-instance's
own handler and all its notify references are untouched.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@tkipkurgat
tkipkurgat merged commit 2f96dde into main Sep 30, 2026
7 checks passed
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.

1 participant