Keep a sub-proxy's returner config out of the shared load (#70219) - #70220
Open
ggiesen wants to merge 1 commit into
Open
Keep a sub-proxy's returner config out of the shared load (#70219)#70220ggiesen wants to merge 1 commit into
ggiesen wants to merge 1 commit into
Conversation
…70219) handle_payload hands the same publish-load dict to the control proxy and to every sub-proxy the job matched. thread_return then merged this sub-proxy's opts["return"] back into data["ret"], writing it onto the dict the next sub-proxy is about to read. With multiprocessing: False every sub-proxy's job runs as a thread in the one salt-proxy process, so whichever ran first stamped its returner configuration onto the ones after it, and a sub-proxy with no returner of its own sent its job return to another sub-proxy's returner. With the default multiprocessing: True each job is forked, so the mutation stayed process-local and nothing leaked -- but multiprocessing: False is what a proxy driving a real device needs, a live NETCONF/SSH session not being forkable. Keep the merge in a local instead. thread_multi_return only reads data["ret"] and is left alone.
twangboy
approved these changes
Sep 2, 2026
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?
Stops one deltaproxy sub-proxy's
returnconfiguration leaking onto its siblings.What issues does this PR fix?
Fixes #70219
Root cause
handle_payloadhands the same publish-load dict to the control proxy and to every sub-proxy the job matched -- there is no copy.thread_returnthen merged the sub-proxy's own returner setting back into it:With
multiprocessing: Falseevery sub-proxy's job runs as a thread in the one salt-proxy process, so they share that dict and whichever sub-proxy ran first stamped its configuration onto the ones that ran after it. With the defaultmultiprocessing: Trueeach job is forked, so the mutation stayed process-local and nothing leaked -- butmultiprocessing: Falseis what a proxy driving a real device needs, since a live NETCONF/SSH session cannot be forked.Keeping the merge in a local fixes it.
thread_multi_returnonly readsdata["ret"]and is left alone.Previous Behavior
A sub-proxy with no returner configured sent its job return to another sub-proxy's returner, whenever a job matched more than one sub-proxy.
New Behavior
Each sub-proxy uses only its own
returnconfiguration.Merge requirements satisfied?
Tests written?
Yes. A unit test in
tests/pytests/unit/metaproxy/test_deltaproxy.pydrivesthread_returntwice against one shared load, first as a sub-proxy that has a returner configured and then as one that does not, asserting the shared load is never written to. It fails against unmodified 3008.x, where the second sub-proxy picks upsome_returner.Verified against a live deltaproxy on 3008.2 with three sub-proxies and a returner configured on
minion1only. Instrumentingthread_returnshows all three sharing one load object:before
after
minion1still uses its own returner; its siblings are no longer contaminated.Commits signed with GPG?
No