diff --git a/mxqd.c b/mxqd.c index 7d188810..8d98ad09 100644 --- a/mxqd.c +++ b/mxqd.c @@ -1081,6 +1081,13 @@ int reaper_process(struct mxq_server *server,struct mxq_group_list *glist, struc } gettimeofday(&now, NULL); timersub(&now, &job->stats_starttime, &realtime); + + if (realtime.tv_sec<30) { + int wait=30-realtime.tv_sec; + mx_log_warning("user process finished to fast (%ld seconds) : delaying termination for %d seconds",realtime.tv_sec,wait); + sleep(wait); + } + res = getrusage(RUSAGE_CHILDREN, &rusage); if (res < 0) { mx_log_err("reaper: getrusage: %m");