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.
PR fixes a couple of bugs that we discovered when investigating a situation where a failed POST request was causing a job to time out:
One-line fix for a Context-cancellation issue that can cause indefinite hangs when the Context expires during a backoff wait period (a bug I introduced in Listen for context cancellation during backoff period #44 😬 )
Larger fix around request body handling. The general gist of it is that currently when pester retries requests with request bodies, it will either return an
error
complaining aboutContentLength=<some number> with Body length 0
or send the destination server a request with an empty body, depending on the type ofio.Reader
used and how you made the request. If you checkout c1c03d2 the added tests will demonstrate this behaviour. This issue badly exacerbates the first one since it means that any request with a body will never succeed on retries, and thus any request with a non-empty body that doesn't succeed the first time will result in an indefinite hang unless it happens to reachMaxAttempts
first or be Context-cancelled while making the request.