Skip to content

fix(ns-ha): added locking mechanism on switch#1548

Merged
Tbaile merged 3 commits intomainfrom
ha-switch-locking
Mar 10, 2026
Merged

fix(ns-ha): added locking mechanism on switch#1548
Tbaile merged 3 commits intomainfrom
ha-switch-locking

Conversation

@Tbaile
Copy link
Collaborator

@Tbaile Tbaile commented Mar 3, 2026

Closes: #1547

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-lock and 999-unlock keepalived hotplug scripts to serialize state-transition event handling.
  • Install the new hotplug scripts via the ns-ha package 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.

Copy link
Member

@gsanchietti gsanchietti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤞

@gsanchietti gsanchietti marked this pull request as ready for review March 3, 2026 16:35
@Tbaile Tbaile changed the base branch from main to release-8.7.2 March 4, 2026 09:39
@Tbaile Tbaile force-pushed the release-8.7.2 branch 3 times, most recently from 42930d2 to 4f55e81 Compare March 5, 2026 09:17
@Tbaile Tbaile force-pushed the ha-switch-locking branch from cebeaa0 to 9bbc4e4 Compare March 5, 2026 09:47
Base automatically changed from release-8.7.2 to main March 6, 2026 15:56
@Tbaile Tbaile force-pushed the ha-switch-locking branch from 9bbc4e4 to 1e20897 Compare March 10, 2026 08:49
@Tbaile Tbaile force-pushed the ha-switch-locking branch from 1e20897 to 97dd8bc Compare March 10, 2026 08:57
@Tbaile Tbaile merged commit 20d7224 into main Mar 10, 2026
0 of 2 checks passed
@Tbaile Tbaile deleted the ha-switch-locking branch March 10, 2026 09:03
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.

ns-ha: possible race condition if switches happen close to one another

3 participants