You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "juzi050 (via GitHub)" <gi...@apache.org> on 2026/08/01 18:05:05 UTC

[PR] fix(triple): clean up REST form request decoder [dubbo]

juzi050 opened a new pull request, #16412:
URL: https://github.com/apache/dubbo/pull/16412

   What is the purpose of the change?
   
   Closes #16403.
   
   When Triple REST parses an `application/x-www-form-urlencoded` or `multipart/form-data` request, `DefaultHttpRequest` lazily creates and caches an `HttpPostRequestDecoder`. The decoder was not destroyed after the request completed, so `DefaultHttpDataFactory` continued to retain the request and its form data.
   
   This change attaches decoder cleanup to the HTTP response termination lifecycle:
   
   - Add a dedicated method to destroy the decoder cached by `DefaultHttpRequest`.
   - Clean up the decoder when the HTTP/1.1 or HTTP/2 server response observer terminates.
   - Cover normal completion, error responses, and connection closure while ensuring cleanup runs only once when termination events race.
   - Delay cleanup until response termination so multipart data remains available to the service method during request processing.
   
   ## How was it tested?
   
   Added `HttpPostRequestDecoderLifecycleTest`, which sends a form request through the real Triple REST request path and compares the number of requests tracked by `DefaultHttpDataFactory` before and after the request.
   
   - Before the fix: the test consistently failed because one request increased the tracked count from `0` to `1`.
   - After the fix: `Tests run: 1, Failures: 0, Errors: 0, Skipped: 0`.
   
   Command:
   
   ```shell
   ./mvnw -pl dubbo-rpc/dubbo-rpc-triple -am -Dtest=HttpPostRequestDecoderLifecycleTest -Dsurefire.failIfNoSpecifiedTests=false test
   ```
   
   The changed files were also formatted with `codestyle/dubbo_codestyle_for_idea.xml`. Maven Checkstyle and Spotless checks passed.
   
   ## Checklist
   
   - [x] Make sure there is a [GitHub_issue](https://github.com/apache/dubbo/issues) field for the change.
   - [x] Write a pull request description that is detailed enough to understand what the pull request does, how it does it, and why it does it.
   - [x] Write necessary unit-test to verify the code.
   - [x] Make sure gitHub actions can pass.
   


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] fix(triple): clean up REST form request decoder [dubbo]

Posted by "juzi050 (via GitHub)" <gi...@apache.org>.
juzi050 closed pull request #16412: fix(triple): clean up REST form request decoder
URL: https://github.com/apache/dubbo/pull/16412


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] fix(triple): clean up REST form request decoder [dubbo]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #16412:
URL: https://github.com/apache/dubbo/pull/16412#issuecomment-5152797644

   ## [Codecov](https://app.codecov.io/gh/apache/dubbo/pull/16412?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `62.06897%` with `11 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 36.92%. Comparing base ([`3a30432`](https://app.codecov.io/gh/apache/dubbo/commit/3a3043227f5571d25eb2889de5bca22f2914843b?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`cb5bce3`](https://app.codecov.io/gh/apache/dubbo/commit/cb5bce3e200cbf4acfda2a14f95449abdffff7e2?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/dubbo/pull/16412?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...ting/http12/AbstractServerHttpChannelObserver.java](https://app.codecov.io/gh/apache/dubbo/pull/16412?src=pr&el=tree&filepath=dubbo-remoting%2Fdubbo-remoting-http12%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fdubbo%2Fremoting%2Fhttp12%2FAbstractServerHttpChannelObserver.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctaHR0cDEyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy9odHRwMTIvQWJzdHJhY3RTZXJ2ZXJIdHRwQ2hhbm5lbE9ic2VydmVyLmphdmE=) | 75.00% | [3 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/dubbo/pull/16412?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...bo/remoting/http12/message/DefaultHttpRequest.java](https://app.codecov.io/gh/apache/dubbo/pull/16412?src=pr&el=tree&filepath=dubbo-remoting%2Fdubbo-remoting-http12%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fdubbo%2Fremoting%2Fhttp12%2Fmessage%2FDefaultHttpRequest.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctaHR0cDEyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy9odHRwMTIvbWVzc2FnZS9EZWZhdWx0SHR0cFJlcXVlc3QuamF2YQ==) | 40.00% | [2 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/dubbo/pull/16412?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...tocol/tri/h12/AbstractServerTransportListener.java](https://app.codecov.io/gh/apache/dubbo/pull/16412?src=pr&el=tree&filepath=dubbo-rpc%2Fdubbo-rpc-triple%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fdubbo%2Frpc%2Fprotocol%2Ftri%2Fh12%2FAbstractServerTransportListener.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy10cmlwbGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9wcm90b2NvbC90cmkvaDEyL0Fic3RyYWN0U2VydmVyVHJhbnNwb3J0TGlzdGVuZXIuamF2YQ==) | 50.00% | [1 Missing and 2 partials :warning: ](https://app.codecov.io/gh/apache/dubbo/pull/16412?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...12/http1/DefaultHttp11ServerTransportListener.java](https://app.codecov.io/gh/apache/dubbo/pull/16412?src=pr&el=tree&filepath=dubbo-rpc%2Fdubbo-rpc-triple%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fdubbo%2Frpc%2Fprotocol%2Ftri%2Fh12%2Fhttp1%2FDefaultHttp11ServerTransportListener.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy10cmlwbGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9wcm90b2NvbC90cmkvaDEyL2h0dHAxL0RlZmF1bHRIdHRwMTFTZXJ2ZXJUcmFuc3BvcnRMaXN0ZW5lci5qYXZh) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/dubbo/pull/16412?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   > :exclamation:  There is a different number of reports uploaded between BASE (3a30432) and HEAD (cb5bce3). Click for more details.
   > 
   > <details><summary>HEAD has 5 uploads less than BASE</summary>
   >
   >| Flag | BASE (3a30432) | HEAD (cb5bce3) |
   >|------|------|------|
   >|unit-tests-java25|1|0|
   >|unit-tests-java8|1|0|
   >|unit-tests-java17|1|0|
   >|unit-tests-java21|1|0|
   >|unit-tests-java11|1|0|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@              Coverage Diff              @@
   ##                3.3   #16412       +/-   ##
   =============================================
   - Coverage     60.87%   36.92%   -23.96%     
   + Complexity    11766    11750       -16     
   =============================================
     Files          1953     1952        -1     
     Lines         89273    89278        +5     
     Branches      13473    13392       -81     
   =============================================
   - Hits          54346    32965    -21381     
   - Misses        29333    51724    +22391     
   + Partials       5594     4589     -1005     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/dubbo/pull/16412/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [integration-tests-java21](https://app.codecov.io/gh/apache/dubbo/pull/16412/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `32.15% <62.06%> (+<0.01%)` | :arrow_up: |
   | [integration-tests-java8](https://app.codecov.io/gh/apache/dubbo/pull/16412/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `32.23% <62.06%> (+0.01%)` | :arrow_up: |
   | [samples-tests-java21](https://app.codecov.io/gh/apache/dubbo/pull/16412/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `32.12% <0.00%> (-0.08%)` | :arrow_down: |
   | [samples-tests-java8](https://app.codecov.io/gh/apache/dubbo/pull/16412/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `29.83% <0.00%> (+0.04%)` | :arrow_up: |
   | [unit-tests-java11](https://app.codecov.io/gh/apache/dubbo/pull/16412/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [unit-tests-java17](https://app.codecov.io/gh/apache/dubbo/pull/16412/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [unit-tests-java21](https://app.codecov.io/gh/apache/dubbo/pull/16412/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [unit-tests-java25](https://app.codecov.io/gh/apache/dubbo/pull/16412/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [unit-tests-java8](https://app.codecov.io/gh/apache/dubbo/pull/16412/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/dubbo/pull/16412?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org