Skip to content

OBS04O-106 | Close request entity InputStream after executeAndClose - #139

Merged
vijaypdwivedi merged 2 commits into
masterfrom
feature-OBS04O-106-Jersey2-inputstream-connection
Aug 27, 2026
Merged

OBS04O-106 | Close request entity InputStream after executeAndClose#139
vijaypdwivedi merged 2 commits into
masterfrom
feature-OBS04O-106-Jersey2-inputstream-connection

Conversation

@vijaypdwivedi

@vijaypdwivedi vijaypdwivedi commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Ticket : OBS04O-106

  • Jersey 2's Apache HTTP connector does not close the request entity InputStream after consuming it during PUT operations (Jersey 1 did)
  • This causes failures in callers that wrap the stream with a digest-computing decorator (e.g. DigestInputStream, ecs-sync's
    EnhancedInputStream) and try to read the digest after the request
  • The fix closes the InputStream in AbstractJerseyClient.executeAndClose()inside a finally block

Impact analysis

  • Only PutObjectRequest and UploadPartRequest can have InputStream entities — all other 26 callers of executeAndClose use JAXB beans or non-stream types and are unaffected
  • Retry logic in S3JerseyClient.executeWithRetry() is not impacted because retries complete inside executeRequest() before thefinally block runs
  • Double-close is safe per the Java InputStream contract

Test plan

  • testPutObjectClosesInputStream — verifies close() is called
  • testPutObjectStreamDigestAccessible — verifies MD5 digest readable after putObject (ecs-sync pattern)
  • testUploadPartClosesInputStream — verifies close() for MPU path
  • Full object-client test suite: 52 failures baseline → 52 with fix (zero regressions)
  • Full ecs-sync s3-storage test suite: 6 failures baseline → 4 with fix (testNormalUpload and testLargeFileUploaderStream now pass)

@vijaypdwivedi
vijaypdwivedi merged commit c07bc62 into master Aug 27, 2026
@vijaypdwivedi
vijaypdwivedi deleted the feature-OBS04O-106-Jersey2-inputstream-connection branch August 27, 2026 04:57
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.

2 participants