From 5be9fbb6896048cdfa698d66fe05949878006a84 Mon Sep 17 00:00:00 2001 From: Dmitrii Kuvaiskii Date: Fri, 8 Nov 2019 15:17:22 -0800 Subject: [PATCH] [LibOS] shim_ipc_helper.c: Actually wait for 0.5 seconds on IPC exit Before exiting, the IPC helper is supposed to wait for 0.5s for all in-flight IPC messages to reach their destinations (e.g., child processes). Otherwise, the destination processes may become abandoned zombies. Previously, this was achieved by `DkThreadDelayExecution(500)`. However, this function uses microseconds not milliseconds, thus, Graphene actually waited only for 0.005 seconds (which is not enough under heavy system-wide load). This commit fixes this time-unit bug. --- LibOS/shim/src/ipc/shim_ipc_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LibOS/shim/src/ipc/shim_ipc_helper.c b/LibOS/shim/src/ipc/shim_ipc_helper.c index de072499..bfdc2877 100644 --- a/LibOS/shim/src/ipc/shim_ipc_helper.c +++ b/LibOS/shim/src/ipc/shim_ipc_helper.c @@ -869,7 +869,7 @@ struct shim_thread* terminate_ipc_helper(void) { * prevent such cases, we simply wait for a bit before exiting. * */ debug("Waiting for 0.5s for all in-flight IPC messages to reach their destinations\n"); - DkThreadDelayExecution(500); + DkThreadDelayExecution(500000); /* in microseconds */ lock(&ipc_helper_lock); if (ipc_helper_state != HELPER_ALIVE) {