MLE-32953 Prevent retries of multipart streaming requests - #1979
Draft
rjdew-progress wants to merge 1 commit into
Draft
rjdew-progress wants to merge 1 commit into
rjdew-progress wants to merge 1 commit into
Conversation
rjdew-progress
requested review from
RitaChen609,
jonmille,
ngodugu-marklogic and
rjrudin
as code owners
September 22, 2026 23:04
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Multipart bodies wrapping InputStreamHandle may still be replayed because one-shot status is not propagated through ObjectRequestBody.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Prevents retries of multipart requests containing one-shot streaming bodies.
Changes:
- Marks
StreamingOutputImplas one-shot. - Honors OkHttp’s
isOneShot()contract in retry handling. - Adds multipart streaming regression coverage.
| File | Reviewed change |
|---|---|
marklogic-client-api/src/test/java/com/marklogic/client/impl/StreamingOutputImplTest.java |
Tests one-shot multipart behavior. |
marklogic-client-api/src/main/java/com/marklogic/client/impl/StreamingOutputImpl.java |
Declares streaming bodies as one-shot. |
marklogic-client-api/src/main/java/com/marklogic/client/impl/okhttp/RetryIOExceptionInterceptor.java |
Avoids retries for one-shot request bodies. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+46
to
+47
| if (requestBody != null && (requestBody.isOneShot() || | ||
| requestBody instanceof RetryableRequestBody body && !body.isRetryable())) { |
rjdew-progress
marked this pull request as draft
September 23, 2026 20:34
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.

Why
A Data Services request with streaming multipart input can fail with
Stream closedafter a preceding gzipped Row Manager response. The IOException retry interceptor sees only the outerMultipartBody, so it can retry the request even though a nestedStreamingOutputImplhas already consumed and closed its source.Approach
StreamingOutputImplas one-shot using OkHttp's nativeRequestBody.isOneShot()contract.isOneShot()in addition to the Java Client'sRetryableRequestBodycontract.MultipartBodyand prevents a second request attempt.Validation
./gradlew marklogic-client-api:test --tests com.marklogic.client.impl.StreamingOutputImplTestlocalhost:8012.