aboutsummaryrefslogtreecommitdiffstats
path: root/executor/executor_akaros.cc
diff options
context:
space:
mode:
Diffstat (limited to 'executor/executor_akaros.cc')
-rw-r--r--executor/executor_akaros.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/executor/executor_akaros.cc b/executor/executor_akaros.cc
index 3f0ffb5a8..76006b513 100644
--- a/executor/executor_akaros.cc
+++ b/executor/executor_akaros.cc
@@ -46,8 +46,20 @@ int main(int argc, char** argv)
fail("execl failed");
return 0;
}
+
int status = 0;
- while (waitpid(pid, &status, 0) != pid) {
+ uint64 start = current_time_ms();
+ for (;;) {
+ int res = waitpid(-1, &status, WNOHANG);
+ if (res == pid)
+ break;
+ usleep(1000);
+ if (current_time_ms() - start < 6 * 1000)
+ continue;
+ kill(pid, SIGKILL);
+ while (waitpid(-1, &status, 0) != pid) {
+ }
+ break;
}
status = WEXITSTATUS(status);
if (status == kFailStatus)