[lxc-devel] [PATCH 1/2] Support starting containers concurrently

S.Çağlar Onur caglar at 10ur.org
Mon Apr 15 05:55:22 UTC 2013


From: "S.Çağlar Onur" <caglar at 10ur.org>

Trying to start multiple containers concurrently may cause lxc_monitor_read_timeout to fail as select call could be interrupted by a signal, handle it.
---
 src/lxc/state.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/lxc/state.c b/src/lxc/state.c
index 95707ac..c50ef00 100644
--- a/src/lxc/state.c
+++ b/src/lxc/state.c
@@ -230,8 +230,13 @@ extern int lxc_wait(const char *lxcname, const char *states, int timeout, const
 				goto out_close;
 			curtime = tv.tv_sec;
 		}
-		if (lxc_monitor_read_timeout(fd, &msg, timeout) < 0)
-			goto out_close;
+		if (lxc_monitor_read_timeout(fd, &msg, timeout) < 0) {
+			/* continue if select interrupted by signal */
+			if (errno == EINTR)
+				continue;
+			else
+				goto out_close;
+		}
 
 		if (timeout != -1) {
 			retval = gettimeofday(&tv, NULL);
-- 
1.7.10.4





More information about the lxc-devel mailing list