This is an automated email from the ASF dual-hosted git repository.

rainyu pushed a commit to branch 3.3
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.3 by this push:
     new 763e8bb773 HttpPostRequestDecoder need be destroyed. (#15788)
763e8bb773 is described below

commit 763e8bb773befbcca31278ddd5713b14fb0198b8
Author: Rain Yu <[email protected]>
AuthorDate: Sun Nov 23 20:00:19 2025 +0800

    HttpPostRequestDecoder need be destroyed. (#15788)
---
 .../qos/command/decoder/HttpCommandDecoder.java    | 39 +++++++++++++---------
 1 file changed, 23 insertions(+), 16 deletions(-)

diff --git 
a/dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/command/decoder/HttpCommandDecoder.java
 
b/dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/command/decoder/HttpCommandDecoder.java
index 2d0367ae6a..f46cf3eaa6 100644
--- 
a/dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/command/decoder/HttpCommandDecoder.java
+++ 
b/dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/command/decoder/HttpCommandDecoder.java
@@ -55,24 +55,31 @@ public class HttpCommandDecoder {
                                 CommandContextFactory.newInstance(name, 
valueList.toArray(new String[] {}), true);
                     }
                 } else if (request.method() == HttpMethod.POST) {
-                    HttpPostRequestDecoder httpPostRequestDecoder = new 
HttpPostRequestDecoder(request);
-                    List<String> valueList = new ArrayList<>();
-                    for (InterfaceHttpData interfaceHttpData : 
httpPostRequestDecoder.getBodyHttpDatas()) {
-                        if (interfaceHttpData.getHttpDataType() == 
InterfaceHttpData.HttpDataType.Attribute) {
-                            Attribute attribute = (Attribute) 
interfaceHttpData;
-                            try {
-                                valueList.add(attribute.getValue());
-                            } catch (IOException ex) {
-                                throw new RuntimeException(ex);
+                    HttpPostRequestDecoder httpPostRequestDecoder = null;
+                    try {
+                        httpPostRequestDecoder = new 
HttpPostRequestDecoder(request);
+                        List<String> valueList = new ArrayList<>();
+                        for (InterfaceHttpData interfaceHttpData : 
httpPostRequestDecoder.getBodyHttpDatas()) {
+                            if (interfaceHttpData.getHttpDataType() == 
InterfaceHttpData.HttpDataType.Attribute) {
+                                Attribute attribute = (Attribute) 
interfaceHttpData;
+                                try {
+                                    valueList.add(attribute.getValue());
+                                } catch (IOException ex) {
+                                    throw new RuntimeException(ex);
+                                }
                             }
                         }
-                    }
-                    if (valueList.isEmpty()) {
-                        commandContext = 
CommandContextFactory.newInstance(name);
-                        commandContext.setHttp(true);
-                    } else {
-                        commandContext =
-                                CommandContextFactory.newInstance(name, 
valueList.toArray(new String[] {}), true);
+                        if (valueList.isEmpty()) {
+                            commandContext = 
CommandContextFactory.newInstance(name);
+                            commandContext.setHttp(true);
+                        } else {
+                            commandContext =
+                                    CommandContextFactory.newInstance(name, 
valueList.toArray(new String[] {}), true);
+                        }
+                    } finally {
+                        if (httpPostRequestDecoder != null) {
+                            httpPostRequestDecoder.destroy();
+                        }
                     }
                 }
             } else if (array.length == 3) {

Reply via email to