Skip to content

Nonblocking warnings - #6

Merged
ps-groscoe merged 1 commit into
mainfrom
faster-warnings
Oct 15, 2026
Merged

ps-groscoe merged 1 commit into
mainfrom
faster-warnings

Conversation

@nakulj

@nakulj nakulj commented Oct 9, 2026 •

Copy link
Copy Markdown

Background

In --parallel mode, Worker.warning_added sends each warning to the controller with a blocking XML-RPC report_warning call. The controller serves every worker on one thread, and that thread also runs hooks.test_distributed inside get_test, so a warning waits behind whatever the controller is doing for other workers. In monorail CI the Backslash plugin's test_distributed held that thread for 12–38 s, which timed out test steps that log warnings inside a wall-clock budget (parallelsystems/monorail#16187).

Description

  • warning_added hands 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.
  • Each send creates its own ServerProxy, so no proxy is shared between threads. A failed send is logged instead of raised.
  • report_session_error still 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_server checks that warning_added returns while the controller is still handling the report, and that the warning arrives afterwards. tests/test_parallel.py and tests/test_plugin_parallel.py pass locally (62 tests).

🤖 Generated with Claude Code

@nakulj nakulj changed the title Nonblocking warnings/errors Nonblocking warnings Oct 9, 2026
@nakulj
nakulj requested a review from ps-groscoe October 9, 2026 19:13

@ps-groscoe ps-groscoe left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ps-groscoe
ps-groscoe merged commit 27d52d0 into main Oct 15, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants