Repository navigation
Nonblocking warnings - #6
Merged
Merged
Conversation
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.
Background
In
--parallelmode,Worker.warning_addedsends each warning to the controller with a blocking XML-RPCreport_warningcall. The controller serves every worker on one thread, and that thread also runshooks.test_distributedinsideget_test, so a warning waits behind whatever the controller is doing for other workers. In monorail CI the Backslash plugin'stest_distributedheld that thread for 12–38 s, which timed out test steps that log warnings inside a wall-clock budget (parallelsystems/monorail#16187).Description
warning_addedhands the pickled warning to a single background thread (ThreadPoolExecutor(max_workers=1)) and returns without waiting. Warnings are still pickled on the calling thread and sent in order.ServerProxy, so no proxy is shared between threads. A failed send is logged instead of raised.report_session_errorstill blocks.A warning logged in a child process forked from a worker is not sent. In tmux mode, warnings still queued when the controller stops waiting for a worker are dropped.
Verification
test_worker_warning_does_not_wait_for_serverchecks thatwarning_addedreturns while the controller is still handling the report, and that the warning arrives afterwards.tests/test_parallel.pyandtests/test_plugin_parallel.pypass locally (62 tests).🤖 Generated with Claude Code