Skip to content

Destroy MinionManager event resources deterministically - #70179

Merged
dwoz merged 1 commit into
saltstack:3008.xfrom
twangboy:fix/70175/3008.x
Oct 21, 2026
Merged

dwoz merged 1 commit into
saltstack:3008.xfrom
twangboy:fix/70175/3008.x

Conversation

@twangboy

@twangboy twangboy commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Destroys the MinionManager when the minion loses its master connection with no working failover.

cli/daemons.py's Minion.start() never called destroy() when _real_start() raised SaltClientError because self.minion.restart was True -- it just returned (or looped for multi-master failover), leaving event_publisher / event to be reclaimed only by __del__'s GC-time safety net.

  • salt/cli/daemons.py: Minion.start() now destroys the MinionManager on SaltClientError, both before retrying (daemonized multi-master failover) and before falling through to the final break / return.

The companion gap in MinionManager.destroy() (it never closed event_publisher / event) was fixed in #70258, and related leaks in #70206, #70257, #70259 and #70261, so that work is not repeated here.

What issues does this PR fix or reference?

Refs #70175

Merge requirements satisfied?

  • Docs
  • Changelog
  • Tests written/updated

Commits signed with GPG?

Yes

@twangboy
twangboy requested a review from a team as a code owner August 28, 2026 19:48
@twangboy twangboy self-assigned this Aug 28, 2026
@twangboy twangboy added the test:full Run the full test suite label Aug 28, 2026
@twangboy twangboy added this to the Argon v3008.3 milestone Aug 28, 2026
twangboy added a commit to twangboy/salt that referenced this pull request Aug 28, 2026
pre-commit's pinned black (24.2.0) wraps these with/patch.object chains
differently than a newer local black run had produced. Fixes the
"Pre-Commit / Run Pre-Commit Against Salt" CI failure on PR saltstack#70179.
twangboy added a commit to twangboy/salt that referenced this pull request Sep 11, 2026
pre-commit's pinned black (24.2.0) wraps these with/patch.object chains
differently than a newer local black run had produced. Fixes the
"Pre-Commit / Run Pre-Commit Against Salt" CI failure on PR saltstack#70179.
@twangboy twangboy modified the milestones: Argon v3008.3, Argon v3008.5 Oct 1, 2026
Minion.start() never called destroy() when _real_start() raised
SaltClientError because self.minion.restart was True, leaving
event_publisher/event to be reclaimed only by __del__'s GC-time
safety net. Destroy the MinionManager both before the daemonized
multi-master failover retry and before the final return.

The companion gap in MinionManager.destroy() was fixed in saltstack#70258.

Refs saltstack#70175

This branch was previously deployed

1 inactive deployment
ci — 8a1b8e47 Deployed Oct 19, 2026 by twangboy via Build Onedir Packages / RPM (x86_64) #27566
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants