From c05eebb1e4ace4afb9f904179363b1b67c61a551 Mon Sep 17 00:00:00 2001 From: obdev Date: Sat, 10 Feb 2024 02:19:25 +0000 Subject: [PATCH] terminate rpc only used for remote execute --- deps/oblib/src/rpc/obrpc/ob_poc_rpc_proxy.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deps/oblib/src/rpc/obrpc/ob_poc_rpc_proxy.cpp b/deps/oblib/src/rpc/obrpc/ob_poc_rpc_proxy.cpp index da1c07d6a7..042f65e515 100644 --- a/deps/oblib/src/rpc/obrpc/ob_poc_rpc_proxy.cpp +++ b/deps/oblib/src/rpc/obrpc/ob_poc_rpc_proxy.cpp @@ -67,7 +67,9 @@ int ObSyncRespCallback::wait(const int64_t wait_timeout_us, const int64_t pcode, const struct timespec ts = {1, 0}; bool has_terminated = false; while(ATOMIC_LOAD(&cond_) == 0) { - if (!has_terminated && OB_ERR_SESSION_INTERRUPTED == THIS_WORKER.check_status()) { + if (OB_UNLIKELY((obrpc::OB_REMOTE_SYNC_EXECUTE == pcode || obrpc::OB_REMOTE_EXECUTE == pcode) + && !has_terminated + && OB_ERR_SESSION_INTERRUPTED == THIS_WORKER.check_status())) { RPC_LOG(INFO, "check session killed, will execute pn_terminate_pkt", K(gtid_), K(pkt_id_)); int err = 0; if ((err = pn_terminate_pkt(gtid_, pkt_id_)) != 0) {