From b389ff66e0630a4a675784aefa8494026ef3ec52 Mon Sep 17 00:00:00 2001 From: Bomin Zhang Date: Mon, 14 Sep 2020 14:53:03 +0800 Subject: [PATCH] TD-1359: add recv timeout for accepted tcp socket this is a quick fix for td-1359, and perhaps also a fix for td-1420. --- src/rpc/src/rpcTcp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rpc/src/rpcTcp.c b/src/rpc/src/rpcTcp.c index 3475e0f317..56b3fa8616 100644 --- a/src/rpc/src/rpcTcp.c +++ b/src/rpc/src/rpcTcp.c @@ -245,6 +245,8 @@ static void *taosAcceptTcpConnection(void *arg) { } taosKeepTcpAlive(connFd); + struct timeval to={1, 0}; + taosSetSockOpt(connFd, SOL_SOCKET, SO_RCVTIMEO, &to, sizeof(to)); // pick up the thread to handle this connection pThreadObj = pServerObj->pThreadObj + threadId; -- GitLab