add rpc sync read timeout
This commit is contained in:
parent
365d535e6d
commit
b9b62a9a00
|
@ -163,6 +163,7 @@ int rpcReleaseHandle(void *handle, int8_t type); // just release conn to rpc in
|
||||||
// These functions will not be called in the child process
|
// These functions will not be called in the child process
|
||||||
int rpcSendRequestWithCtx(void *thandle, const SEpSet *pEpSet, SRpcMsg *pMsg, int64_t *rid, SRpcCtx *ctx);
|
int rpcSendRequestWithCtx(void *thandle, const SEpSet *pEpSet, SRpcMsg *pMsg, int64_t *rid, SRpcCtx *ctx);
|
||||||
int rpcSendRecv(void *shandle, SEpSet *pEpSet, SRpcMsg *pReq, SRpcMsg *pRsp);
|
int rpcSendRecv(void *shandle, SEpSet *pEpSet, SRpcMsg *pReq, SRpcMsg *pRsp);
|
||||||
|
int rpcSendRecvWithTimeout(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRpcMsg *pRsp, int32_t timeoutMs);
|
||||||
int rpcSetDefaultAddr(void *thandle, const char *ip, const char *fqdn);
|
int rpcSetDefaultAddr(void *thandle, const char *ip, const char *fqdn);
|
||||||
void *rpcAllocHandle();
|
void *rpcAllocHandle();
|
||||||
void rpcSetIpWhite(void *thandl, void *arg);
|
void rpcSetIpWhite(void *thandl, void *arg);
|
||||||
|
|
|
@ -160,7 +160,7 @@ void dmSendStatusReq(SDnodeMgmt *pMgmt) {
|
||||||
|
|
||||||
SEpSet epSet = {0};
|
SEpSet epSet = {0};
|
||||||
dmGetMnodeEpSet(pMgmt->pData, &epSet);
|
dmGetMnodeEpSet(pMgmt->pData, &epSet);
|
||||||
rpcSendRecv(pMgmt->msgCb.statusClientRpc, &epSet, &rpcMsg, &rpcRsp);
|
rpcSendRecvWithTimeout(pMgmt->msgCb.statusClientRpc, &epSet, &rpcMsg, &rpcRsp, 1000);
|
||||||
if (rpcRsp.code != 0) {
|
if (rpcRsp.code != 0) {
|
||||||
dmRotateMnodeEpSet(pMgmt->pData);
|
dmRotateMnodeEpSet(pMgmt->pData);
|
||||||
char tbuf[256];
|
char tbuf[256];
|
||||||
|
|
Loading…
Reference in New Issue