lxc/0106-set-timeout-to-1s-for-cmds-send-to-lxc-monitor.patch

32 lines
1.2 KiB
Diff
Raw Normal View History

2019-12-25 15:57:42 +08:00
From 412831f8677bfe78a9e473a473c29e1441cf7fe9 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
2019-12-25 15:57:42 +08:00
Subject: [PATCH 106/131] 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
2019-12-25 15:57:42 +08:00
index c74b8c1f..0802a167 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) {
--
2019-12-25 15:57:42 +08:00
2.23.0
2019-09-30 11:03:07 -04:00