Port two missed job-dispatch fixes to the metaproxies (#70215) - #70216
Open
ggiesen wants to merge 1 commit into
Open
Port two missed job-dispatch fixes to the metaproxies (#70215)#70216ggiesen wants to merge 1 commit into
ggiesen wants to merge 1 commit into
Conversation
deltaproxy still double-forked every job. thread_return and thread_multi_return kept the daemonize_if block that 9f1fe42 ("Call os.fork less to avoid race conditions", 2019) removed from salt/minion.py and salt/metaproxy/proxy.py, two years before deltaproxy.py was forked from proxy.py. With the default multiprocessing: True that reparents the job to init, so the proxy's SubprocessList entry dies immediately and neither process_count_max nor the shutdown path can see the process actually doing the work. Both metaproxies also appended to the process title on every job. The guard added to salt/minion.py in 26fed3b for saltstack#68553 never reached salt/metaproxy/deltaproxy.py or salt/metaproxy/proxy.py, so with multiprocessing: False -- which a proxy driving a real device generally needs, a live NETCONF/SSH session not being forkable -- each job rewrites the running daemon's title until the argv buffer fills and saturates mid-word, leaving ps output unreadable.
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?
Ports two fixes that landed in
salt/minion.pybut never reached the metaproxies.What issues does this PR fix?
Fixes #70215
Root cause
deltaproxy still double-forked every job.
thread_returnandthread_multi_returnkept thedaemonize_ifblock that 9f1fe42 ("Call os.fork less to avoid race conditions", 2019) removed fromsalt/minion.pyandsalt/metaproxy/proxy.py-- two years beforedeltaproxy.pywas forked fromproxy.py, so it was carried in with the fork. With the defaultmultiprocessing: Truethe job is reparented to init, so the proxy'sSubprocessListentry dies immediately and neitherprocess_count_maxnor the shutdown path can see or control the process actually doing the work.Both metaproxies appended to the process title on every job. The guard added to
salt/minion.pyin 26fed3b for #68553 never reachedsalt/metaproxy/deltaproxy.pyorsalt/metaproxy/proxy.py. Withmultiprocessing: Falsethe job runs in a thread of the live daemon, so each job rewrites the running process's title until the argv buffer fills and saturates mid-word.multiprocessing: Falseis the normal configuration for a proxy driving a real device, since a live NETCONF/SSH session cannot be forked.Note this PR fixes
proxy.pyas well asdeltaproxy.pyfor the second item -- the single-proxy metaproxy was missed by #68553 in exactly the same way, so fixing only deltaproxy would leave half the port undone.Previous Behavior
deltaproxy job processes were orphaned to init, and with
multiprocessing: Falseboth metaproxies filled the daemon's process title with repeated_thread_returnentries, leavingpsandtopoutput unreadable.New Behavior
Job processes stay children of the salt-proxy, matching
salt/minion.pyandsalt/metaproxy/proxy.py. The process title is left alone when the job is not getting its own process, and is still set when it is.Merge requirements satisfied?
Tests written?
Yes. Three unit tests in
tests/pytests/unit/metaproxy/test_deltaproxy.pydrivingdeltaproxy.thread_return: it must not calldaemonize_if; it must not touch the process title whenmultiprocessingis disabled; and the inverse, that it still sets the title when the job really does get its own process, so the guard cannot silently drop the title everywhere. The first two fail against unmodified 3008.x.Verified against a live deltaproxy on 3008.2 (one control proxy, three
dummysub-proxies):multiprocessing: True, job process parentageppid=1, orphaned to initmultiprocessing: False, process title over 20 jobs_thread_return, then saturatedCommits signed with GPG?
No