zmuxuny opened a new issue, #7398:
URL: https://github.com/apache/rocketmq-dashboard/issues/7398

   ### Before Creating the Bug Report
   
   - [x] I have searched the [open 
issues](https://github.com/apache/rocketmq-dashboard/issues) of this repository 
and believe that this is not a duplicate.
   
   - [x] This is a defect in RocketMQ Studio, not a usage question and not a 
defect in another Apache RocketMQ repository.
   
   - [x] I can reproduce this on the current `rocketmq-studio` branch, or I 
have stated the exact version I am running below.
   
   
   ### Studio Version
   
   rocketmq-studio at 7abf8adaf660d75f2d686bbe8741be76c3a5ddd3 (also the 
current upstream head when checked on 2026-11-05).
   
   ### Runtime Environment
   
   Linux, JDK 21, Spring Web 7.0.8. Reproduced in isolated Java tests using 
real HTTP connections to local loopback fixtures with synthetic data. No live 
Prometheus, DingTalk or SMS endpoint was contacted. Test-only mocks/subclasses 
admit the loopback fixture; production URL validation was not changed, and no 
DNS override was used.
   
   ### Connected RocketMQ Cluster
   
   Not applicable. These operations are data-source connection probes and 
notification webhook delivery; the reproduction does not require a RocketMQ 
cluster.
   
   ### Build Toolchain
   
   JDK 21 and Maven 3.9.9. This is a runtime response-handling defect, not a 
build/startup failure.
   
   ### Describe the Bug
   
   SettingsService data-source connection tests call 
retrieve().body(String.class), and NotificationOutboxService sends DingTalk/SMS 
webhooks through RestTemplate. Neither client currently imposes an HTTP 
response-body byte limit before string conversion or HTTP error handling. A 
responding endpoint can therefore cause a large successful or error response to 
be buffered. Existing connection/read timeouts do not impose a response-size 
bound. The existing Prometheus metrics-query limits do not cover these separate 
integration paths.
   
   ### Steps to Reproduce
   
   1. Check out the version above and construct each service with its 
production HTTP client/request factory. Keep repositories and credentials 
synthetic. In the test harness only, admit a local loopback HTTP fixture 
through the existing URL-validation seams.
   2. For a data-source probe, have the fixture return HTTP 200 with valid 
Prometheus success JSON padded with JSON whitespace to 5,242,881 bytes. Repeat 
with a fixed Content-Length and with chunked transfer encoding. Exercise HTTP 
500 with an oversized body as well.
   3. For SMS and DingTalk, invoke the webhook path against the same local 
fixture, using a valid small success response as a control and success/error 
responses exceeding 5,242,880 bytes for the negative cases. For DingTalk 
success, use an errcode of 0 and pad the JSON with whitespace.
   4. Observe the bytes retained/converted and the resulting service outcome. A 
response-size rejection should happen before conversion or error-body 
buffering. Do not point this reproduction at a real notification endpoint.
   
   ### What Did You Expect to See?
   
   A documented response-body budget should apply before success-body 
conversion and HTTP error-body buffering in both integration paths. A small 
response should retain its existing status/body handling, while an oversized 
response should fail clearly and release its stream/response. Notification 
retry/exhaustion behavior, URL validation, redirect handling and timeouts 
should remain intact.
   
   Proposal for maintainer discussion: use a shared 5 MiB (5,242,880-byte) 
application-body budget, matching the existing metrics-query byte budget. 
Reject an oversized advertised Content-Length and otherwise read at most the 
limit plus one byte to detect overflow. Close the upstream body stream before 
closing the response so Spring response cleanup does not deliberately drain the 
remaining stream. The threshold and cleanup approach are proposals, not an 
agreed design.
   
   ### What Did You See Instead?
   
   The unmodified service sources did not enforce that budget in real local 
HTTP tests with fixed-length/chunked bodies. In three oversized webhook HTTP 
500 controls, Spring raised HttpServerErrorException.InternalServerError with 
status 500 and retained a 5,242,881-byte response body, rather than a 
size-limit exception. The exception type/status and body length were checked, 
so those failures were not inferred from a timeout. Small-response controls 
continued to behave normally.
   
   Local positive/base/restored comparisons of a candidate fix distinguished 11 
expected size-limit assertion failures from 4 passing controls in a 15-case 
service-level loopback matrix. This is local regression evidence, not a claim 
about production behavior or an exact TCP byte cap.
   
   ### Additional Context
   
   Related history: https://github.com/apache/rocketmq-dashboard/pull/6927 was 
automatically closed by the stale bot and has no human design review or linked 
tracking issue. This report records the defect and proposed policy for 
discussion before a replacement contribution proceeds. It does not reopen that 
PR.
   
   The transport can buffer or receive extra bytes independently of the 
application read budget, and JDK stream cleanup can consume already-buffered 
data. A 5 MiB application limit therefore must not be advertised as an exact 
TCP receive limit. No production safety claim is made.
   
   Searched existing response-body, Content-Length, webhook and data-source 
issues. #1004 concerns already-resolved Prometheus range-query cardinality; 
#5145 is a separate Go CLI response cap. Neither tracks this defect. AI 
assistance was used for source review and local regression validation.
   
   ### Are You Willing to Submit a Pull Request?
   
   - [x] Yes, I am willing to submit a pull request.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to