Skip to content

timeout from _send_req_async#69415

Open
dwoz wants to merge 6 commits into
saltstack:3008.xfrom
dwoz:reqtimeout-3008
Open

timeout from _send_req_async#69415
dwoz wants to merge 6 commits into
saltstack:3008.xfrom
dwoz:reqtimeout-3008

Conversation

@dwoz

@dwoz dwoz commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

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.

@dwoz dwoz requested a review from a team as a code owner June 11, 2026 04:28
@dwoz dwoz added the test:full Run the full test suite label Jun 11, 2026
@dwoz dwoz changed the base branch from master to 3008.x June 11, 2026 05:39
@dwoz dwoz changed the title WIP 3008 WIP timeout from _send_req_async Jun 11, 2026
Daniel A. Wozniak 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant