Skip to content

fix: bound integration HTTP response bodies - #6927

Merged
lizhimins merged 2 commits into
apache:masterfrom
zmuxuny:fix/integration-response-body-budget
Nov 27, 2026
Merged

lizhimins merged 2 commits into
apache:masterfrom
zmuxuny:fix/integration-response-body-budget

Conversation

@zmuxuny

@zmuxuny zmuxuny commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Brief Description

Bound the datasource connection-test and notification webhook HTTP response bodies to 5 MiB (5,242,880 bytes), matching the existing Prometheus metrics-query budget.

A shared interceptor runs before Spring's string conversion and HTTP error handling. It rejects an oversized advertised Content-Length, and otherwise reads at most the limit plus one byte, so missing or understated lengths are handled consistently. Accepted responses retain their status, headers and body; rejected responses close their streams and responses.

Datasource tests report a specific size-limit failure. Webhook delivery uses the existing retry/exhaustion policy. Timeouts, URL validation and redirect behavior are unchanged. The server README documents the boundary.

How Did You Test This Change?

Verified on rocketmq-studio@c34535db0819d02f68e50a856cb3d2614f0dc5dd, using Temurin 21.0.12.1 and Maven 3.9.11.

cd server
mvn -B -ntp \
  -Dtest=BoundedResponseBodyInterceptorTest,SettingsServiceTest,NotificationResponseBodyLimitTest,NotificationOutboxServiceTest,DataSourceClientHttpRequestFactoryTest \
  test
  • Focused matrix: 119 tests, 0 failures, 0 errors, 0 skipped.
  • Checkstyle: 0 violations; git diff --check passes.
  • Coverage includes success/error statuses, exact-limit acceptance, absent/understated Content-Length, bounded incremental reads, stream/response cleanup, small error details, timeout/redirect behavior, and notification retry/exhaustion.
  • Negative control: the 14 new service-level size-limit cases fail against unchanged production sources at the base commit (14 assertion failures, 0 errors), and pass with the patch.

Runner details: Maven/test heaps were capped at 512 MiB and Mockito was attached with -javaagent. The existing NotificationOutboxServiceTest mock fixtures use example.com; the cloud runner's DNS environment rejects that name before the mocked request. For the 119-test run only, -Djdk.net.hosts.file=<test-hosts-file> mapped it to the documentation address 192.0.2.1. No OS hosts file was changed. The new response-limit tests use numeric documentation addresses and pass without this override; all HTTP responses are in-process fixtures.

No live integration endpoint, full MySQL-backed backend suite, frontend build or production deployment was exercised locally. CI status should be assessed on this PR's actual head.

Checklist

  • One coherent change; no unrelated refactor or dependency change
  • Conventional commit subject
  • Regression tests use the ...Test naming convention
  • New source files carry ASF license headers
  • Changed behavior documented in server/README.md

AI assistance was used for implementation, independent code review and test execution.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

This pull request has been automatically closed because there has been no activity for 7 days. If you would like to continue working on this, please reopen the PR with updated changes.

@github-actions github-actions Bot added the stale label Nov 1, 2026
@github-actions github-actions Bot closed this Nov 1, 2026
@lizhimins lizhimins reopened this Nov 27, 2026
@lizhimins
lizhimins changed the base branch from rocketmq-studio to master November 27, 2026 04:41
@lizhimins
lizhimins merged commit abbff96 into apache:master Nov 27, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants