Repository navigation
fix(reqrespquery): return an error when the response timeout expires without a response - #575
Open
pcbeingused333 wants to merge 1 commit into
Open
pcbeingused333 wants to merge 1 commit into
pcbeingused333 wants to merge 1 commit into
Conversation
…without a response
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.
Requester.RequestUppercasereturns("", nil)whenResponseTimeoutelapses 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 returnedctx.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 lasterris nil and the parentctxis still alive, soctx.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(wrappingpollCtx.Err()).Test
TestRequesterTimeoutWithoutResponseuses a mocked client whose query always succeeds without a response and a 50msResponseTimeout. It fails onmain(no error returned) and passes with this change;go test ./reqrespquery/andgo vetpass.Reproduction
Signal the target workflow while the worker is slow or stopped (or use a short
ResponseTimeout):RequestUppercasereturns 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.