Fix: Job killed by time limit is incorrectly catalogued as NO_FILE_OUTPUT (#252)

As the value of the askForRendererKill flag is set right after the return of the kill process, under some particular memory and system load circumstances, a race condition occurs and the rendering process in the main thread is closed faster than the process.destroy() returns the control to the thread the called the OS.getOS().kill(process.getProcess()) method. If that condition occurs, the isAskForRendererKill() check returns false (the flag hasn't been set to True in the separate thread) and the execution continues with the frame output check (that doesn't exist as the rendering process was interrupted). The final outcome is a wrong NO_FILE_OUTPUT error instead of the proper RENDERER_KILLED_BY_USER_OVER_TIME.

The fix has been setting the askForRendererKill flag to true before the process is destroyed. If the racing condition occurs, the askForRendererKill will be correctly set.
This commit is contained in:
Luis Uguina
2020-06-12 19:32:06 +10:00
committed by GitHub
parent e06a9a9c1b
commit 8736892565

View File

@@ -280,9 +280,9 @@ import lombok.Getter;
if (process != null) {
long duration = (new Date().getTime() - process.getStartTime()) / 1000; // in seconds
if (configuration.getMaxRenderTime() > 0 && duration > configuration.getMaxRenderTime()) {
setAskForRendererKill(true);
log.debug("Killing render because process duration");
OS.getOS().kill(process.getProcess());
setAskForRendererKill(true);
}
}
}