timeout from _send_req_async#69415
Open
dwoz wants to merge 6 commits into
Open
Conversation
added 6 commits
June 12, 2026 17:07
…rocess When req_channel.send() times out in the main process event handler, fire an error sentinel back via the return event so worker threads wake up immediately instead of hanging until their own timeout expires. Replace the bare TimeoutError raised in _send_req_sync with SaltReqTimeoutError so _return_pub's existing handler catches both cases correctly. Also set language_version: python3.14 on the lint pre-commit hooks to avoid native wheel build failures (pygit2/multidict) under Python 3.12.
Fix the functional test that was asserting the wrong exception type (bare TimeoutError instead of SaltReqTimeoutError), and add a unit test that exercises the end-to-end contract: _return_pub must catch SaltReqTimeoutError from _send_req_sync and return "" gracefully rather than letting the exception propagate.
_return_pub now computes an effective timeout that is the max of the caller-supplied timeout and the main process's full retry budget (return_retry_timer_max * return_retry_tries). This prevents the worker thread from timing out and raising SaltReqTimeoutError before the main process has had a chance to finish its retries and fire the return event.
…ocol
The existing test mocked event.get_event() as a bare MagicMock; our new
error-sentinel check (ret.get("error")) treated the MagicMock return as
truthy and incorrectly raised SaltReqTimeoutError. Fix the mock to return
a proper {"ret": True} dict matching the event protocol.
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.
The timeout from _send_req_async could end up being shorter than actual timeout in handle_event. Make this whole thing more deterministic by signaling an actual timeout by passing it back in the return to _send_req_async.