Repository navigation
fix: rename alerting role's Restart Tomcat handler to avoid collision - #111
Merged
Merged
Conversation
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>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
alertingrole (PR feat: co-located Alertmanager alerting hub #83) defines its ownRestart Tomcathandler, identically named tocreate-instance's handler that restarts the DHIS2 instance's tomcat service after a war deploy.notify:by name across the whole play. On plain instance hosts where thealertingrole's handler ends up gated/skipped, it silently shadowscreate-instance's own handler — the restart notification never reaches the handler that actually restarts tomcat.ClassNotFoundException).deploy-war.yml'snotify/flush_handlerschain exists specifically to recover from this via a restart, but with the name collisionRUNNING HANDLER [alerting : Restart Tomcat]showsskippingfor the instance host, so the real restart never fires and the instance is left permanently serving 404.alertingrole's handler toRestart Tomcat (alerting)and updated its one caller (peer_glowroot.yml).create-instance's own handler and all of itsnotifyreferences are untouched.Test plan
ansible-playbook dhis2.yml --syntax-checkpassesorigin/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