From 6b60aa54bf0b9effd88d00896045d0f4f836bb25 Mon Sep 17 00:00:00 2001 From: Albumen Kevin Date: Thu, 5 Sep 2024 10:05:26 +0800 Subject: [PATCH 1/4] Fix native image ci configuration --- .github/workflows/build-and-test-scheduled-3.3.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-and-test-scheduled-3.3.yml b/.github/workflows/build-and-test-scheduled-3.3.yml index 08673d0d563..3240efb8f8a 100644 --- a/.github/workflows/build-and-test-scheduled-3.3.yml +++ b/.github/workflows/build-and-test-scheduled-3.3.yml @@ -490,13 +490,16 @@ jobs: - name: "Compile Dubbo (Linux)" run: | cd ${{ github.workspace }}/dubbo - ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean install -DskipTests=true -DskipIntegrationTests=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true + ./mvnw ${{ env.MAVEN_ARGS }} -T 2C clean install -P '!demo',skip-spotless -Dmaven.test.skip=true -Dcheckstyle.skip=true -Dcheckstyle_unix.skip=true -Drat.skip=true - name: "Compile and run Dubbo demo for native (Linux)" run: | - cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-provider - ${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true native:compile + cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-interface + MVNW="${{ github.workspace }}/dubbo/mvnw ${{ env.MAVEN_ARGS }} -T 2C -Dmaven.test.skip=true" + $MVNW clean install + cd ../dubbo-demo-native-provider + $MVNW clean package -P native native:compile nohup ./target/dubbo-demo-native-provider & - cd ${{ github.workspace }}/dubbo/dubbo-demo/dubbo-demo-native/dubbo-demo-native-consumer - ${{ github.workspace }}/dubbo/mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast -T 2C clean package -P native -Dmaven.test.skip=true native:compile + cd ../dubbo-demo-native-consumer + $MVNW clean package -P native native:compile ./target/dubbo-demo-native-consumer From 883c79558290f3a951cfa00134bf5fc92e2e7537 Mon Sep 17 00:00:00 2001 From: Zaki <91261012+cnzakii@users.noreply.github.com> Date: Fri, 6 Sep 2024 09:34:25 +0800 Subject: [PATCH 2/4] docs: update issue template (#14634) --- .github/ISSUE_TEMPLATE/1-bug.yml | 1 + .github/ISSUE_TEMPLATE/2-feature.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/1-bug.yml b/.github/ISSUE_TEMPLATE/1-bug.yml index e3a2b406853..9f6cc59a1ec 100644 --- a/.github/ISSUE_TEMPLATE/1-bug.yml +++ b/.github/ISSUE_TEMPLATE/1-bug.yml @@ -71,6 +71,7 @@ body: - "Java Integration Cases (apache/dubbo-integration-cases)" - "Java SPI Extensions (apache/dubbo-spi-extensions)" - "Java Benchmark (apache/dubbo-benchmark)" + - "Python SDK (apache/dubbo-python)" validations: required: true diff --git a/.github/ISSUE_TEMPLATE/2-feature.yml b/.github/ISSUE_TEMPLATE/2-feature.yml index 702836ad139..986c16dbe8b 100644 --- a/.github/ISSUE_TEMPLATE/2-feature.yml +++ b/.github/ISSUE_TEMPLATE/2-feature.yml @@ -66,6 +66,7 @@ body: - "Java Integration Cases (apache/dubbo-integration-cases)" - "Java SPI Extensions (apache/dubbo-spi-extensions)" - "Java Benchmark (apache/dubbo-benchmark)" + - "Python SDK (apache/dubbo-python)" validations: required: true From ac6704d532ca814dbf989dd20ea31716eabc6990 Mon Sep 17 00:00:00 2001 From: The True HOOHA <2722539@qq.com> Date: Fri, 6 Sep 2024 09:37:18 +0800 Subject: [PATCH 3/4] Update BraveAutoConfiguration.java (#14631) The bean 'correlationFieldsCorrelationScopeCustomizer', defined in class path resource [org/apache/dubbo/spring/boot/observability/autoconfigure/brave/BraveAutoConfiguration$BraveBaggageConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/boot/actuate/autoconfigure/tracing/BravePropagationConfigurations$PropagationWithBaggage.class] and overriding is disabled. --- .../autoconfigure/brave/BraveAutoConfiguration.java | 1 + 1 file changed, 1 insertion(+) diff --git a/dubbo-spring-boot/dubbo-spring-boot-starters/observability/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/observability/autoconfigure/brave/BraveAutoConfiguration.java b/dubbo-spring-boot/dubbo-spring-boot-starters/observability/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/observability/autoconfigure/brave/BraveAutoConfiguration.java index b3134e75763..b80166c0dd4 100644 --- a/dubbo-spring-boot/dubbo-spring-boot-starters/observability/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/observability/autoconfigure/brave/BraveAutoConfiguration.java +++ b/dubbo-spring-boot/dubbo-spring-boot-starters/observability/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/observability/autoconfigure/brave/BraveAutoConfiguration.java @@ -272,6 +272,7 @@ brave.baggage.CorrelationScopeDecorator.Builder mdcCorrelationScopeDecoratorBuil prefix = ObservabilityUtils.DUBBO_TRACING_BAGGAGE_CORRELATION, name = "enabled", matchIfMissing = true) + @ConditionalOnMissingBean brave.baggage.CorrelationScopeCustomizer correlationFieldsCorrelationScopeCustomizer() { return (builder) -> { List correlationFields = this.dubboConfigProperties From 08c74b79d254426351062560f5e5c00e02275517 Mon Sep 17 00:00:00 2001 From: TomlongTK Date: Sat, 7 Sep 2024 00:15:15 +0800 Subject: [PATCH 4/4] Close stream when channel was inactive (#14643) refine --- .../dubbo/rpc/protocol/tri/call/TripleClientCall.java | 8 ++++++++ .../dubbo/rpc/protocol/tri/stream/ClientStream.java | 2 ++ .../dubbo/rpc/protocol/tri/stream/TripleClientStream.java | 5 +++++ .../dubbo/rpc/protocol/tri/stream/TripleServerStream.java | 8 ++++++++ .../rpc/protocol/tri/transport/H2TransportListener.java | 2 ++ .../tri/transport/TripleHttp2ClientResponseHandler.java | 1 + .../rpc/protocol/tri/stream/MockClientStreamListener.java | 3 +++ .../tri/transport/AbstractH2TransportListenerTest.java | 3 +++ 8 files changed, 32 insertions(+) diff --git a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/call/TripleClientCall.java b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/call/TripleClientCall.java index 330deaa0bd9..ead2951da68 100644 --- a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/call/TripleClientCall.java +++ b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/call/TripleClientCall.java @@ -136,6 +136,14 @@ public void onComplete( } } + @Override + public void onClose() { + if (done) { + return; + } + onCancelByRemote(TriRpcStatus.CANCELLED); + } + @Override public void onStart() { listener.onStart(TripleClientCall.this); diff --git a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/stream/ClientStream.java b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/stream/ClientStream.java index 304d3c46539..d0a73c0eef8 100644 --- a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/stream/ClientStream.java +++ b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/stream/ClientStream.java @@ -56,6 +56,8 @@ default void onComplete( boolean isReturnTriException) { onComplete(status, attachments); } + + void onClose(); } /** diff --git a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/stream/TripleClientStream.java b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/stream/TripleClientStream.java index 8b060ae82df..120b6489b62 100644 --- a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/stream/TripleClientStream.java +++ b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/stream/TripleClientStream.java @@ -472,5 +472,10 @@ public void cancelByRemote(long errorCode) { finishProcess(transportError, null, false); }); } + + @Override + public void onClose() { + executor.execute(listener::onClose); + } } } diff --git a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/stream/TripleServerStream.java b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/stream/TripleServerStream.java index e093e748c56..aa8799a39ef 100644 --- a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/stream/TripleServerStream.java +++ b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/stream/TripleServerStream.java @@ -483,6 +483,14 @@ public void cancelByRemote(long errorCode) { executor.execute(() -> listener.onCancelByRemote( TriRpcStatus.CANCELLED.withDescription("Canceled by client ,errorCode=" + errorCode))); } + + @Override + public void onClose() { + if (listener == null) { + return; + } + executor.execute(() -> listener.onCancelByRemote(TriRpcStatus.CANCELLED)); + } } private static class ServerDecoderListener implements TriDecoder.Listener { diff --git a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/transport/H2TransportListener.java b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/transport/H2TransportListener.java index 2d6c62e0be4..78f0569ac41 100644 --- a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/transport/H2TransportListener.java +++ b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/transport/H2TransportListener.java @@ -42,4 +42,6 @@ public interface H2TransportListener { void onData(ByteBuf data, boolean endStream); void cancelByRemote(long errorCode); + + void onClose(); } diff --git a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/transport/TripleHttp2ClientResponseHandler.java b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/transport/TripleHttp2ClientResponseHandler.java index b8e9230eb50..e7a1d8b2971 100644 --- a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/transport/TripleHttp2ClientResponseHandler.java +++ b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/transport/TripleHttp2ClientResponseHandler.java @@ -80,6 +80,7 @@ private void onResetRead(ChannelHandlerContext ctx, Http2ResetFrame resetFrame) @Override public void channelInactive(ChannelHandlerContext ctx) { + transportListener.onClose(); ctx.close(); } diff --git a/dubbo-rpc/dubbo-rpc-triple/src/test/java/org/apache/dubbo/rpc/protocol/tri/stream/MockClientStreamListener.java b/dubbo-rpc/dubbo-rpc-triple/src/test/java/org/apache/dubbo/rpc/protocol/tri/stream/MockClientStreamListener.java index 4daeea81370..35219f1f05b 100644 --- a/dubbo-rpc/dubbo-rpc-triple/src/test/java/org/apache/dubbo/rpc/protocol/tri/stream/MockClientStreamListener.java +++ b/dubbo-rpc/dubbo-rpc-triple/src/test/java/org/apache/dubbo/rpc/protocol/tri/stream/MockClientStreamListener.java @@ -36,6 +36,9 @@ public void onComplete(TriRpcStatus status, Map attachments) { this.status = status; } + @Override + public void onClose() {} + @Override public void onMessage(byte[] message, boolean isNeedReturnException) { this.message = message; diff --git a/dubbo-rpc/dubbo-rpc-triple/src/test/java/org/apache/dubbo/rpc/protocol/tri/transport/AbstractH2TransportListenerTest.java b/dubbo-rpc/dubbo-rpc-triple/src/test/java/org/apache/dubbo/rpc/protocol/tri/transport/AbstractH2TransportListenerTest.java index 92d5b3c65cc..e17496372ba 100644 --- a/dubbo-rpc/dubbo-rpc-triple/src/test/java/org/apache/dubbo/rpc/protocol/tri/transport/AbstractH2TransportListenerTest.java +++ b/dubbo-rpc/dubbo-rpc-triple/src/test/java/org/apache/dubbo/rpc/protocol/tri/transport/AbstractH2TransportListenerTest.java @@ -40,6 +40,9 @@ public void onData(ByteBuf data, boolean endStream) {} @Override public void cancelByRemote(long errorCode) {} + + @Override + public void onClose() {} }; DefaultHttp2Headers headers = new DefaultHttp2Headers(); headers.scheme(HTTPS.name()).path("/foo.bar").method(HttpMethod.POST.asciiName());