fix(ns-ha): added locking mechanism on switch#1548
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to fix a race condition in ns-ha where keepalived state transitions that occur in quick succession can overlap, causing services (e.g., dedalo/dpi) to be stopped after being restarted. It introduces a hotplug-level serialization mechanism and improves hotplug logging for clearer diagnostics.
Changes:
- Add
00-lockand999-unlockkeepalived hotplug scripts to serialize state-transition event handling. - Install the new hotplug scripts via the
ns-hapackage Makefile. - Enrich keepalived hotplug service logs with the triggering “reason” (which callback condition matched).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/ns-ha/files/00-lock | Adds a global keepalived hotplug lock acquisition step for transition events. |
| packages/ns-ha/files/999-unlock | Releases the global keepalived hotplug lock at the end of the chain. |
| packages/ns-ha/Makefile | Installs the new lock/unlock hotplug scripts. |
| packages/keepalived/files/lib/functions/keepalived/hotplug.sh | Improves log messages by including the condition that triggered the action. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
gsanchietti
reviewed
Mar 3, 2026
gsanchietti
reviewed
Mar 3, 2026
gsanchietti
reviewed
Mar 3, 2026
42930d2 to
4f55e81
Compare
cebeaa0 to
9bbc4e4
Compare
9bbc4e4 to
1e20897
Compare
1e20897 to
97dd8bc
Compare
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.
Closes: #1547