2020-01-05 22:20:49 -05:00
|
|
|
From a57a384e7d39498a2d70027f67aa9dc1d1db2ea4 Mon Sep 17 00:00:00 2001
|
2019-09-30 11:03:07 -04:00
|
|
|
From: LiFeng <lifeng68@huawei.com>
|
|
|
|
|
Date: Thu, 6 Jun 2019 22:48:38 -0400
|
2020-01-05 22:20:49 -05:00
|
|
|
Subject: [PATCH 106/138] set timeout to 1s for cmds send to [lxc monitor]
|
2019-09-30 11:03:07 -04:00
|
|
|
|
|
|
|
|
Signed-off-by: LiFeng <lifeng68@huawei.com>
|
|
|
|
|
---
|
|
|
|
|
src/lxc/commands.c | 6 +++---
|
|
|
|
|
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
|
|
|
|
|
|
|
|
diff --git a/src/lxc/commands.c b/src/lxc/commands.c
|
2020-01-05 22:20:49 -05:00
|
|
|
index c74b8c1..0802a16 100644
|
2019-09-30 11:03:07 -04:00
|
|
|
--- a/src/lxc/commands.c
|
|
|
|
|
+++ b/src/lxc/commands.c
|
|
|
|
|
@@ -127,10 +127,10 @@ static int lxc_cmd_rsp_recv(int sock, struct lxc_cmd_rr *cmd)
|
|
|
|
|
int ret, rspfd;
|
|
|
|
|
struct lxc_cmd_rsp *rsp = &cmd->rsp;
|
|
|
|
|
|
|
|
|
|
- /*isulad: add timeout 200ms to avoid long block due to [lxc monitor] error*/
|
|
|
|
|
- ret = lxc_abstract_unix_recv_fds_timeout(sock, &rspfd, 1, rsp, sizeof(*rsp), 200 * 1000);
|
|
|
|
|
+ /*isulad: add timeout 1s to avoid long block due to [lxc monitor] error*/
|
|
|
|
|
+ ret = lxc_abstract_unix_recv_fds_timeout(sock, &rspfd, 1, rsp, sizeof(*rsp), 1000 * 1000);
|
|
|
|
|
if (ret < 0) {
|
|
|
|
|
- SYSWARN("Failed to receive response for command \"%s\"",
|
|
|
|
|
+ SYSERROR("Failed to receive response for command \"%s\"",
|
|
|
|
|
lxc_cmd_str(cmd->req.cmd));
|
|
|
|
|
|
|
|
|
|
if (errno == ECONNRESET || errno == EAGAIN || errno == EWOULDBLOCK) {
|
|
|
|
|
--
|
2020-01-05 22:20:49 -05:00
|
|
|
1.8.3.1
|
2019-09-30 11:03:07 -04:00
|
|
|
|