Skip to content

fix(reqrespquery): return an error when the response timeout expires without a response - #575

Open
pcbeingused333 wants to merge 1 commit into
temporalio:mainfrom
pcbeingused333:fix/reqrespquery-timeout-error
Open

pcbeingused333 wants to merge 1 commit into
temporalio:mainfrom
pcbeingused333:fix/reqrespquery-timeout-error

Conversation

@pcbeingused333

Copy link
Copy Markdown
Contributor

Requester.RequestUppercase returns ("", nil) when ResponseTimeout elapses and the workflow has not produced a response yet, so the caller cannot tell a timeout from an empty result.

Root cause

On pollCtx.Done() the code returned ctx.Err() unless the last query had failed. When the query itself succeeds but has no response yet (the normal case while the activity is still running), the last err is nil and the parent ctx is still alive, so ctx.Err() is nil and the function returns an empty string and a nil error.

Fix

After the timeout, return the parent context error if it ended; otherwise keep the existing "timeout, last error" error when the last query failed; otherwise return timeout waiting for response: context deadline exceeded (wrapping pollCtx.Err()).

Test

TestRequesterTimeoutWithoutResponse uses a mocked client whose query always succeeds without a response and a 50ms ResponseTimeout. It fails on main (no error returned) and passes with this change; go test ./reqrespquery/ and go vet pass.

Reproduction

Signal the target workflow while the worker is slow or stopped (or use a short ResponseTimeout): RequestUppercase returns an empty string and no error once the timeout passes.


This change was prepared with the assistance of an AI coding agent (Claude) and submitted by a human contributor. Please review it accordingly.

@pcbeingused333
pcbeingused333 requested a review from a team as a code owner November 18, 2026 09:56
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.

1 participant