Skip to content

HDDS-17476. Return correct S3 errors for malformed aws-chunked bodies - #11974

Draft
rich7420 wants to merge 5 commits into
apache:masterfrom
rich7420:HDDS-17476
Draft

rich7420 wants to merge 5 commits into
apache:masterfrom
rich7420:HDDS-17476

Conversation

@rich7420

@rich7420 rich7420 commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

The S3 Gateway parses signed chunk sizes as long and maps overflow to InvalidRequest, avoiding uncaught NumberFormatException. Parser-detected truncation returns IncompleteBody, and malformed trailers return MalformedTrailerError. Signature/checksum error precedence and commit guards are preserved; shared Content-Length mismatch handling remains unchanged.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-17476

How was this patch tested?

  • Local JDK 21: the full S3 Gateway unit suite passed 2065 cases; the final parser suites passed 170 cases, with no failures, errors or skips. Both build caches were disabled.
  • Restoring the base parsers caused all 54 selected regression cases to fail (50 assertion failures and 4 NumberFormatException errors); restoring the fix passed.
  • checkstyle.sh and module PMD passed. The configured SpotBugs 3.1.12.2 cannot analyze Java 17 class files; SpotBugs 4.8.6.8 analysis of the changed production classes reported no new findings against the base and retained one existing constructor warning.
  • Fork CI: https://github.com/rich7420/ozone/actions/runs/42346941773 succeeded for head 19dd8238e0 (113 jobs passed, 2 skipped). S3 Gateway unit tests passed 2065 cases and S3 integration tests passed 383 cases, with no failures, errors or skips in either suite.

Copilot AI balanced review requested due to automatic review settings November 7, 2026 06:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions github-actions Bot added the s3 S3 Gateway label Nov 7, 2026
@adoroszlai
adoroszlai marked this pull request as ready for review November 7, 2026 09:53
@adoroszlai

Copy link
Copy Markdown
Contributor

CLI shows the missing build-branch (fork) check:

$ gh pr checks https://github.com/apache/ozone/pull/11974 
All checks were successful
0 cancelled, 0 failing, 3 successful, 0 skipped, and 0 pending checks

   NAME                                             DESCRIPTION  ELAPSED  URL                                                                      
✓  pull request/build-branch (fork) (pull_request)               1h6m48s  https://github.com/apache/ozone/runs/128326913975
✓  Fork CI ping/ping (pull_request)                              3s       https://github.com/apache/ozone/actions/runs/42361625893/job/128371049224
✓  pull request/title (pull_request)                             8s       https://github.com/apache/ozone/actions/runs/42351747802/job/128341174003

@rich7420

rich7420 commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

@adoroszlai thanks!!

@rich7420
rich7420 marked this pull request as draft November 9, 2026 08:54
@rich7420

rich7420 commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

Moving this to draft for now. HDDS-17478 pulls the shared chunk and trailer parsing into a common base class, so I'd like to land that first and then move these error changes there.

# Conflicts:
#	hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/SignedChunksInputStream.java
#	hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/UnsignedChunksInputStream.java
#	hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/s3/TestSignedChunksInputStream.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

s3 S3 Gateway

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants