This is an automated email from the ASF dual-hosted git repository.
panjuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new ea5e2ec5e2c Fix finish connection if not exist executionId. (#21187)
ea5e2ec5e2c is described below
commit ea5e2ec5e2c8827d77f0886f97c38410db64a177
Author: Chuxin Chen <[email protected]>
AuthorDate: Mon Sep 26 13:47:22 2022 +0800
Fix finish connection if not exist executionId. (#21187)
---
.../proxy/frontend/netty/FrontendChannelInboundHandler.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/netty/FrontendChannelInboundHandler.java
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/netty/FrontendChannelInboundHandler.java
index b359dad73eb..95319adbbbe 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/netty/FrontendChannelInboundHandler.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/netty/FrontendChannelInboundHandler.java
@@ -38,6 +38,8 @@ import
org.apache.shardingsphere.proxy.frontend.spi.DatabaseProtocolFrontendEngi
import org.apache.shardingsphere.proxy.frontend.state.ProxyStateContext;
import org.apache.shardingsphere.transaction.rule.TransactionRule;
+import java.util.Optional;
+
/**
* Frontend channel inbound handler.
*/
@@ -105,7 +107,7 @@ public final class FrontendChannelInboundHandler extends
ChannelInboundHandlerAd
} catch (final BackendConnectionException ex) {
log.error("Exception occurred when frontend connection [{}]
disconnected", connectionSession.getConnectionId(), ex);
}
-
ExecuteProcessEngine.finishConnection(connectionSession.getExecutionId());
+
Optional.ofNullable(connectionSession.getExecutionId()).ifPresent(ExecuteProcessEngine::finishConnection);
databaseProtocolFrontendEngine.release(connectionSession);
}