Skip to content

Add AsyncPillar.aclose so file_client: local minions can connect - #70653

Merged
dwoz merged 3 commits into
saltstack:3008.xfrom
shawnrruss:fix/70637-asyncpillar-aclose
Nov 23, 2026
Merged

dwoz merged 3 commits into
saltstack:3008.xfrom
shawnrruss:fix/70637-asyncpillar-aclose

Conversation

@shawnrruss

Copy link
Copy Markdown

What does this PR do?

Adds AsyncPillar.aclose(). Since 3008.3 the minion awaits async_pillar.aclose() after compiling pillar
(salt/minion.py lines 2405 and 4786), but only AsyncRemotePillar defined it. With file_client: local,
get_async_pillar() returns an AsyncPillar, so _post_master_init and the pillar refresh raise
AttributeError: 'AsyncPillar' object has no attribute 'aclose' and the minion never connects.
The new method calls destroy(), the same teardown the sync path uses.

What issues does this PR fix or reference?

Fixes #70637

Previous Behavior

A minion with file_client: local crashes on connect with the AttributeError above.

New Behavior

The local async pillar closes cleanly; the minion connects and pillar refresh works as in 3008.2.

Merge requirements satisfied?

  • Docs
  • Changelog - changelog/70637.fixed.md
  • Tests written/updated - tests/pytests/unit/pillar/test_async_pillar.py fails on 3008.x without the fix
    (1 failed) and passes with it (1 passed). The existing pillar suite is left to CI.

Commits signed with GPG?

No

AI-assisted: the change was written with AI coding tools; I directed, reviewed and tested it.

@shawnrruss
shawnrruss requested a review from a team as a code owner November 3, 2026 04:19
@dwoz dwoz added the test:full Run the full test suite label Nov 3, 2026
twangboy
twangboy previously approved these changes Nov 5, 2026
Since 3008.3 the minion awaits async_pillar.aclose() after compiling
pillar, but only AsyncRemotePillar defined it. With file_client: local,
get_async_pillar() returns an AsyncPillar, so _post_master_init and the
pillar refresh raised AttributeError and the minion never connected.

AsyncPillar.aclose() now calls destroy(), matching the sync teardown.

Fixes saltstack#70637
Parenthesized `with` statements are Py3.10+ grammar. Salt's Ruff config
targets Py3.8 syntax, which caused `Check new Ruff violations` to fail
with:

    Cannot use parentheses within a `with` statement on Python 3.8
    (syntax was added in Python 3.9)

Switch to `contextlib.ExitStack` so the test still exercises the same
patches in the same order with identical semantics.
@welcome

welcome Bot commented Nov 23, 2026

Copy link
Copy Markdown

Congratulations on your first PR being merged! 🎉

This branch had an error being deployed

1 failed deployment
ci — 1d364160 Deployed Nov 23, 2026 by dwoz via Build Onedir Packages / Windows (amd64) #29404
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.

[Bug]: Minion with file_client: local crashes on connect: 'AsyncPillar' object has no attribute 'aclose'

3 participants