From 92499bd83f77c37ea0a92cf58a7d777d7626b5ee Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Thu, 1 Jul 2021 18:50:31 -0700 Subject: [PATCH] container: wrap execv in retry-on-eintr Apparently, execve(2) can return EINTR on Azure, which results in sporadic failures in crun exec (and possibly crun run). To fix, wrap execv in TEMP_FAILURE_RETRY macro. Signed-off-by: Kir Kolyshkin --- src/libcrun/container.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcrun/container.c b/src/libcrun/container.c index 377895bcd9..2adebea0cd 100644 --- a/src/libcrun/container.c +++ b/src/libcrun/container.c @@ -1447,7 +1447,7 @@ container_init (void *args, char *notify_socket, int sync_socket, libcrun_error_ _exit (ret); } - execv (exec_path, def->process->args); + TEMP_FAILURE_RETRY (execv (exec_path, def->process->args)); if (errno == ENOENT) return crun_make_error (err, errno, "exec container process (missing dynamic library?) `%s`", exec_path); @@ -3252,7 +3252,7 @@ libcrun_container_exec (libcrun_context_t *context, const char *id, runtime_spec TEMP_FAILURE_RETRY (close (pipefd1)); pipefd1 = -1; - execv (exec_path, process->args); + TEMP_FAILURE_RETRY (execv (exec_path, process->args)); libcrun_fail_with_error (errno, "exec"); _exit (EXIT_FAILURE); }