diff --git a/deps/oblib/src/rpc/frame/ob_net_easy.cpp b/deps/oblib/src/rpc/frame/ob_net_easy.cpp index 74efa53635..6582bb1107 100644 --- a/deps/oblib/src/rpc/frame/ob_net_easy.cpp +++ b/deps/oblib/src/rpc/frame/ob_net_easy.cpp @@ -797,9 +797,8 @@ int ObNetEasy::start() LOG_ERROR("eio is NULL, not inited", K(is_inited_), KP_(rpc_eio), KP_(mysql_eio), KP_(batch_rpc_eio), K(ret)); } - // TODO: rpc_port_ might not in use - global_ob_listener = &rpc_listener_; if (OB_SUCC(ret) && rpc_port_ > 0) { + global_ob_listener = &rpc_listener_; if (!global_poc_server.has_start()) { if (OB_FAIL(rpc_listener_.listen_create(rpc_port_))) { LOG_ERROR("create listen failed", K(ret)); diff --git a/deps/oblib/src/rpc/obrpc/ob_listener.cpp b/deps/oblib/src/rpc/obrpc/ob_listener.cpp index 0bae7c2d17..cb27ecb295 100644 --- a/deps/oblib/src/rpc/obrpc/ob_listener.cpp +++ b/deps/oblib/src/rpc/obrpc/ob_listener.cpp @@ -234,7 +234,6 @@ static int connection_redispatch(int conn_fd, io_threads_pipefd_pool_t *ths_fd_p { int ret = OB_SUCCESS; int wrfd = -1; - int count = ths_fd_pool->count; int64_t write_bytes = 0; if (OB_ISNULL(ths_fd_pool)) { @@ -244,6 +243,7 @@ static int connection_redispatch(int conn_fd, io_threads_pipefd_pool_t *ths_fd_p RPC_LOG(ERROR, "conn_fd invalid", K(conn_fd)); ret = OB_INVALID_ARGUMENT; } else { + int count = ths_fd_pool->count; wrfd = ths_fd_pool->pipefd[index % count]; RPC_LOG(INFO, "dipatch", K(conn_fd), K(count), K(index), K(wrfd)); while ((write_bytes = write(wrfd, &conn_fd, sizeof(conn_fd))) < 0 && errno == EINTR); diff --git a/deps/oblib/src/rpc/obrpc/ob_net_client.cpp b/deps/oblib/src/rpc/obrpc/ob_net_client.cpp index 0974ad7ca3..5fe15a5136 100644 --- a/deps/oblib/src/rpc/obrpc/ob_net_client.cpp +++ b/deps/oblib/src/rpc/obrpc/ob_net_client.cpp @@ -53,7 +53,6 @@ int ObNetClient::init_(const ObNetOptions opts) } else if (OB_FAIL(net_.start())) { LOG_ERROR("Start client network fail", K(ret)); } else { - pn_provision(-1, 1, 1); inited_ = true; } diff --git a/deps/oblib/src/rpc/pnio/interface/group.c b/deps/oblib/src/rpc/pnio/interface/group.c index 00db7ad64d..59b78b265d 100644 --- a/deps/oblib/src/rpc/pnio/interface/group.c +++ b/deps/oblib/src/rpc/pnio/interface/group.c @@ -239,9 +239,6 @@ PN_API int pn_provision(int listen_id, int gid, int thread_count) } } pn_grp->count = count; - while(pn_grp->count > thread_count) { - pn_destroy(pn_grp->pn_array[--pn_grp->count]); - } return pn_grp->count; el(); return -1;