test: document and pin that a body-less non-idempotent request is not retried#87
Merged
Merged
Conversation
… retried The retry-safety gate keys body-less requests off method idempotency rather than off the absence of a body: with no body the request is retried only when its method is idempotent, and with a body only when the body is replayable. A consequence that was easy to miss is that a bare POST (a body-less, non-idempotent request, e.g. a trigger/activate-style endpoint) is NOT retried even though it carries no payload to re-send — replaying it could duplicate a side effect the server may already have applied. This behavior was intended but undocumented and untested. Make it explicit: - Spell out the body-less branch in the KDoc of DefaultRetryStep (isRetrySafe and the "Body replayability" section) and the recovery-aware RetryStep (canRetry), stating that body-less retry safety keys off method idempotency. - Tighten the retry idempotency note in docs/pipelines.md to match the actual per-axis gate and call out the bare-POST case. - Add regression tests: a body-less POST against a retryable 503 results in exactly one attempt (no retry), with a body-less PUT control proving the same branch retries an idempotent method. KDoc, docs, and tests only; no public API or behavior change.
…ne RetryStep suite The http.pipeline DefaultRetryStep suite pins that a body-less request's retry eligibility keys off method idempotency (bare POST not retried, body-less PUT retried). The recovery-oriented pipeline.step.retry.RetryStep gate has the same rule but only covered body-bearing requests (non-replayable POST/PUT). Add the two body-less cases there so both gates carry the regression, and cross-reference the mirrored cases in both suites.
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.
Summary
The retry-eligibility gate decides whether a body-less request may be retried based on method idempotency: a request with no body is retried only if its method is idempotent (
GET/HEAD/OPTIONS/PUT/DELETE); a request with a body is retried only if that body is replayable. A consequence is that a barePOST(body-less, non-idempotent) is not retried — even though there is no body to re-send — because retrying a non-idempotent call is unsafe regardless of the body.This is intended behavior, but it was neither documented nor pinned by a test.
Change
RetryStepandDefaultRetryStepKDoc and indocs/pipelines.md, spelling out the body-less/idempotency interaction and the bare-POSTcase.POSTagainst a retryable status (503) results in exactly one attempt (no retry), with a body-lessPUTcontrol demonstrating that the same body-less branch still retries an idempotent method.KDoc, docs, and tests only — no behavior change, no public API change.
Closes #17