fix: initialize self.tok on sub-proxies to prevent AttributeError [fj4WqyCCw3C5ShR1RfB7MoBPTpkRrBFYP1uT35g3MvT] - #70073
Open
waterWang wants to merge 1 commit into
Open
fix: initialize self.tok on sub-proxies to prevent AttributeError [fj4WqyCCw3C5ShR1RfB7MoBPTpkRrBFYP1uT35g3MvT]#70073waterWang wants to merge 1 commit into
waterWang wants to merge 1 commit into
Conversation
Sub-proxies are constructed via ProxyMinion(proxyopts) directly in subproxy_post_master_init and never run connect_master, so self.tok is never set by the usual master-connection path. Any event path that references self.tok (e.g. _fire_master_prepare, _register_resources, _mine_send) raises AttributeError. Setting tok=None is safe because the channel layer's _package_load regenerates the token via self.auth.gen_token(b"salt") on every send, overwriting whatever value was in the load dict. Fixes saltstack#70071
twangboy
requested changes
Aug 18, 2026
twangboy
left a comment
Contributor
There was a problem hiding this comment.
Let's make this against the 3008.x branch. Also, this needs a test and a changelog.
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.
What does this PR do?
Fixes #70071 — deltaproxy sub-proxies raise
AttributeError: 'ProxyMinion' object has no attribute 'tok'when dispatching events.Why?
Sub-proxies are constructed via
ProxyMinion(proxyopts)directly insubproxy_post_master_initand never runconnect_master, soself.tokis never set by the usual master-connection path. Any code path that referencesself.tok(e.g._fire_master_prepare,_register_resources,_mine_send) raisesAttributeError.Fix
Set
_proxy_minion.tok = Noneafter construction insubproxy_post_master_init. This is safe because the channel layer's_package_loadregenerates the token viaself.auth.gen_token(b"salt")on every send, overwriting whatever value was in the load dict.Tests
test_subproxy_post_master_init_packs_per_minion_grainsalready exercises the sub-proxy creation path; added assertion that_proxy_minion.tokis set (not AttributeError).New behavior
Sub-proxies can now fire events to the master without raising
AttributeError.