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

chengyouling pushed a commit to branch 2.9.x
in repository https://gitbox.apache.org/repos/asf/servicecomb-java-chassis.git


The following commit(s) were added to refs/heads/2.9.x by this push:
     new 0feb120c4 fix OOM problem when receive big response of SSE interface 
from backend (#5148)
0feb120c4 is described below

commit 0feb120c49eb30699c79d825bdf631fb918e0470
Author: thisAmateur <[email protected]>
AuthorDate: Wed Jun 17 15:52:09 2026 +0800

    fix OOM problem when receive big response of SSE interface from backend 
(#5148)
---
 .github/workflows/checkstyle.yml                                       | 2 +-
 .github/workflows/maven.yml                                            | 2 +-
 .github/workflows/rat_check.yml                                        | 2 +-
 .github/workflows/spotbugs.yml                                         | 2 +-
 .github/workflows/unit-test-jdk17.yml                                  | 2 +-
 .github/workflows/unit-test-jdk21.yml                                  | 2 +-
 .../common/rest/codec/produce/ProduceEventStreamProcessor.java         | 3 ++-
 7 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/.github/workflows/checkstyle.yml b/.github/workflows/checkstyle.yml
index 21a7e9fbb..4404f6fee 100644
--- a/.github/workflows/checkstyle.yml
+++ b/.github/workflows/checkstyle.yml
@@ -26,7 +26,7 @@ on:
 jobs:
   checkstyle:
     timeout-minutes: 60
-    runs-on: ubuntu-latest
+    runs-on: ubuntu-24.04
     steps:
       - uses: actions/checkout@v3
       - name: Set up jdk
diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index 3a993f008..c1aa36af0 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -29,7 +29,7 @@ jobs:
   build:
 
     timeout-minutes: 60
-    runs-on: ubuntu-latest
+    runs-on: ubuntu-24.04
 
     steps:
     - uses: actions/checkout@v3
diff --git a/.github/workflows/rat_check.yml b/.github/workflows/rat_check.yml
index cc1367a76..2e53ce62d 100644
--- a/.github/workflows/rat_check.yml
+++ b/.github/workflows/rat_check.yml
@@ -29,7 +29,7 @@ on:
 jobs:
   rat_check:
     timeout-minutes: 60
-    runs-on: ubuntu-latest
+    runs-on: ubuntu-24.04
     steps:
       - uses: actions/checkout@v3
       - name: Set up jdk
diff --git a/.github/workflows/spotbugs.yml b/.github/workflows/spotbugs.yml
index cddb5768e..3e81e426c 100644
--- a/.github/workflows/spotbugs.yml
+++ b/.github/workflows/spotbugs.yml
@@ -26,7 +26,7 @@ on:
 jobs:
   spotbugs:
     timeout-minutes: 60
-    runs-on: ubuntu-latest
+    runs-on: ubuntu-24.04
     steps:
       - uses: actions/checkout@v3
       - name: Set up jdk
diff --git a/.github/workflows/unit-test-jdk17.yml 
b/.github/workflows/unit-test-jdk17.yml
index 54efbcce0..af290d5b2 100644
--- a/.github/workflows/unit-test-jdk17.yml
+++ b/.github/workflows/unit-test-jdk17.yml
@@ -27,7 +27,7 @@ on:
 jobs:
   unit-tests:
     timeout-minutes: 60
-    runs-on: ubuntu-latest
+    runs-on: ubuntu-24.04
     steps:
       - uses: actions/checkout@v3
       - name: Set up jdk
diff --git a/.github/workflows/unit-test-jdk21.yml 
b/.github/workflows/unit-test-jdk21.yml
index 96c73067b..9ec9f9c90 100644
--- a/.github/workflows/unit-test-jdk21.yml
+++ b/.github/workflows/unit-test-jdk21.yml
@@ -27,7 +27,7 @@ on:
 jobs:
   unit-tests:
     timeout-minutes: 60
-    runs-on: ubuntu-latest
+    runs-on: ubuntu-24.04
     steps:
       - uses: actions/checkout@v3
       - name: Set up jdk
diff --git 
a/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/codec/produce/ProduceEventStreamProcessor.java
 
b/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/codec/produce/ProduceEventStreamProcessor.java
index 109a460cd..0920ea1c6 100644
--- 
a/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/codec/produce/ProduceEventStreamProcessor.java
+++ 
b/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/codec/produce/ProduceEventStreamProcessor.java
@@ -325,6 +325,7 @@ public class ProduceEventStreamProcessor implements 
ProduceProcessor {
 
   private byte[] readALineOfBytesFromBuffer(ByteBuf buffer) {
     matchingDelimiterIndex = 0;
+    int newLineStartPos = buffer.readerIndex();
     try (final ByteArrayOutputStream bos = new 
ByteArrayOutputStream(buffer.readableBytes())) {
       while (buffer.readableBytes() > 0 && matchingDelimiterIndex < 
lineDelimiterBytes.length) {
         final byte b = buffer.readByte();
@@ -336,7 +337,7 @@ public class ProduceEventStreamProcessor implements 
ProduceProcessor {
       if (matchingDelimiterIndex < lineDelimiterBytes.length) {
         // The newline character was not matched, so this part of the buffer 
does not constitute a complete line of
         // content and needs to remain in the buffer, waiting for the next 
segment to arrive for processing.
-        buffer.writeBytes(bos.toByteArray());
+        buffer.readerIndex(newLineStartPos);
         return null;
       }
       matchingDelimiterIndex = 0;

Reply via email to