Merge branch 'fix/kill_after_vram_error' into 'master'
Kill orphan Blender process after rendering See merge request sheepitrenderfarm/client!221
This commit is contained in:
@@ -534,7 +534,7 @@ import okhttp3.HttpUrl;
|
|||||||
|
|
||||||
if (this.renderingJob.getProcessRender().getProcess() != null) {
|
if (this.renderingJob.getProcessRender().getProcess() != null) {
|
||||||
this.renderingJob.setAskForRendererKill(true);
|
this.renderingJob.setAskForRendererKill(true);
|
||||||
OS.getOS().kill(this.renderingJob.getProcessRender().getProcess());
|
this.renderingJob.getProcessRender().kill();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ import java.util.regex.Pattern;
|
|||||||
setUserBlockJob(true);
|
setUserBlockJob(true);
|
||||||
RenderProcess process = getProcessRender();
|
RenderProcess process = getProcessRender();
|
||||||
if (process != null) {
|
if (process != null) {
|
||||||
OS.getOS().kill(process.getProcess());
|
process.kill();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -374,8 +374,8 @@ import java.util.regex.Pattern;
|
|||||||
long duration = (new Date().getTime() - process.getStartTime()) / 1000; // in seconds
|
long duration = (new Date().getTime() - process.getStartTime()) / 1000; // in seconds
|
||||||
if (configuration.getMaxRenderTime() > 0 && duration > configuration.getMaxRenderTime()) {
|
if (configuration.getMaxRenderTime() > 0 && duration > configuration.getMaxRenderTime()) {
|
||||||
setAskForRendererKill(true);
|
setAskForRendererKill(true);
|
||||||
log.debug("Killing render because process duration");
|
log.debug("Killing render - exceeding allowed process duration");
|
||||||
OS.getOS().kill(process.getProcess());
|
process.kill();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -455,7 +455,6 @@ import java.util.regex.Pattern;
|
|||||||
if (configuration.getMaxAllowedMemory() != -1 && getProcessRender().getMemoryUsed().get() > configuration.getMaxAllowedMemory()) {
|
if (configuration.getMaxAllowedMemory() != -1 && getProcessRender().getMemoryUsed().get() > configuration.getMaxAllowedMemory()) {
|
||||||
log.debug("Blocking render because process ram used (" + getProcessRender().getMemoryUsed().get() + "k) is over user setting (" + configuration
|
log.debug("Blocking render because process ram used (" + getProcessRender().getMemoryUsed().get() + "k) is over user setting (" + configuration
|
||||||
.getMaxAllowedMemory() + "k)");
|
.getMaxAllowedMemory() + "k)");
|
||||||
OS.getOS().kill(process.getProcess());
|
|
||||||
process.finish();
|
process.finish();
|
||||||
if (process.getRenderDuration() == -1) {
|
if (process.getRenderDuration() == -1) {
|
||||||
if (timeStamp == null) {
|
if (timeStamp == null) {
|
||||||
@@ -498,6 +497,7 @@ import java.util.regex.Pattern;
|
|||||||
|
|
||||||
// Put back base icon
|
// Put back base icon
|
||||||
gui.updateTrayIcon(Job.SHOW_BASE_ICON);
|
gui.updateTrayIcon(Job.SHOW_BASE_ICON);
|
||||||
|
process.kill();
|
||||||
for (String logline : configuration.filesystemHealthCheck()) {
|
for (String logline : configuration.filesystemHealthCheck()) {
|
||||||
log.debug(logline);
|
log.debug(logline);
|
||||||
}
|
}
|
||||||
@@ -547,8 +547,9 @@ import java.util.regex.Pattern;
|
|||||||
|
|
||||||
// Put back base icon
|
// Put back base icon
|
||||||
gui.updateTrayIcon(Job.SHOW_BASE_ICON);
|
gui.updateTrayIcon(Job.SHOW_BASE_ICON);
|
||||||
|
|
||||||
log.debug("end of rendering");
|
log.debug("end of rendering");
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception err) {
|
catch (Exception err) {
|
||||||
if (script_file != null) {
|
if (script_file != null) {
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
package com.sheepit.client;
|
package com.sheepit.client;
|
||||||
|
|
||||||
|
import com.sheepit.client.os.OS;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -92,7 +93,19 @@ import oshi.software.os.OSProcess;
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void kill() {
|
||||||
|
if (process != null){
|
||||||
|
try {
|
||||||
|
OS.getOS().kill(process);
|
||||||
|
log.debug("RenderProcess::Process killed");
|
||||||
|
} catch (NullPointerException ex) { // We are racing the system itself, we can't avoid catching NPE's
|
||||||
|
log.debug("RenderProcess::Handled process becoming unavailable before getting killed");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void finish() {
|
public void finish() {
|
||||||
|
kill();
|
||||||
endTime = new Date().getTime();
|
endTime = new Date().getTime();
|
||||||
osProcess = null;
|
osProcess = null;
|
||||||
process = null;
|
process = null;
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ public class Server extends Thread {
|
|||||||
|
|
||||||
if (this.client.getRenderingJob().getProcessRender().getProcess() != null) {
|
if (this.client.getRenderingJob().getProcessRender().getProcess() != null) {
|
||||||
this.client.getRenderingJob().setAskForRendererKill(true);
|
this.client.getRenderingJob().setAskForRendererKill(true);
|
||||||
OS.getOS().kill(this.client.getRenderingJob().getProcessRender().getProcess());
|
this.client.getRenderingJob().getProcessRender().kill();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user