Improvement: do not display an error when the server asked to kill a render

This commit is contained in:
Laurent Clouet
2014-12-03 20:09:50 +00:00
parent 8abcde516f
commit 76c8be9e70
4 changed files with 25 additions and 0 deletions

View File

@@ -224,6 +224,11 @@ public class Client {
this.log.debug("Got work to do id: " + this.renderingJob.getId() + " frame: " + this.renderingJob.getFrameNumber()); this.log.debug("Got work to do id: " + this.renderingJob.getId() + " frame: " + this.renderingJob.getFrameNumber());
ret = this.work(this.renderingJob); ret = this.work(this.renderingJob);
if (ret == Error.Type.RENDERER_KILLED) {
this.log.removeCheckPoint(step);
continue;
}
if (ret != Error.Type.OK) { if (ret != Error.Type.OK) {
Job frame_to_reset = this.renderingJob; // copie it because the sendError will take ~5min to execute Job frame_to_reset = this.renderingJob; // copie it because the sendError will take ~5min to execute
this.renderingJob = null; this.renderingJob = null;
@@ -280,6 +285,7 @@ public class Client {
if (this.renderingJob != null) { if (this.renderingJob != null) {
if (this.renderingJob.getProcess() != null) { if (this.renderingJob.getProcess() != null) {
OS.getOS().kill(this.renderingJob.getProcess()); OS.getOS().kill(this.renderingJob.getProcess());
this.renderingJob.setAskForRendererKill(true);
} }
} }
@@ -633,6 +639,11 @@ public class Client {
if (files.length == 0) { if (files.length == 0) {
this.log.error("Client::runRenderer no picture file found (after finished render (namefile_without_extension " + namefile_without_extension + ")"); this.log.error("Client::runRenderer no picture file found (after finished render (namefile_without_extension " + namefile_without_extension + ")");
if (ajob.getAskForRendererKill()) {
this.log.debug("Client::runRenderer renderer didn't generate any frame but it due to a kill request");
return Error.Type.RENDERER_KILLED;
}
String basename = ""; String basename = "";
try { try {
basename = ajob.getPath().substring(0, ajob.getPath().lastIndexOf('.')); basename = ajob.getPath().substring(0, ajob.getPath().lastIndexOf('.'));

View File

@@ -32,6 +32,7 @@ public class Error {
DOWNLOAD_FILE, DOWNLOAD_FILE,
CAN_NOT_CREATE_DIRECTORY, CAN_NOT_CREATE_DIRECTORY,
NETWORK_ISSUE, RENDERER_CRASHED, NETWORK_ISSUE, RENDERER_CRASHED,
RENDERER_KILLED,
RENDERER_MISSING_LIBRARIES, RENDERER_MISSING_LIBRARIES,
FAILED_TO_EXECUTE, FAILED_TO_EXECUTE,
UNKNOWN UNKNOWN
@@ -122,6 +123,8 @@ public class Error {
return "Renderer have crashed. It's mostly due to a bad project or not enough memory. There is nothing you can do about it. Will try an another project in few minutes."; return "Renderer have crashed. It's mostly due to a bad project or not enough memory. There is nothing you can do about it. Will try an another project in few minutes.";
case RENDERER_MISSING_LIBRARIES: case RENDERER_MISSING_LIBRARIES:
return "Failed to launch runderer. Please check if you have necessary libraries installed and if you have enough free place in working directory."; return "Failed to launch runderer. Please check if you have necessary libraries installed and if you have enough free place in working directory.";
case RENDERER_KILLED:
return "The render stop because either you ask to stop or the server (usually render time too high).";
case SESSION_DISABLED: case SESSION_DISABLED:
return "The server have disabled your session. It's mostly because your client generate broken frame (gpu not compatible for example)."; return "The server have disabled your session. It's mostly because your client generate broken frame (gpu not compatible for example).";
default: default:

View File

@@ -41,6 +41,7 @@ public class Job {
private String updateRenderingStatusMethod; private String updateRenderingStatusMethod;
private Process process; private Process process;
private boolean askForRendererKill;
private Configuration config; private Configuration config;
@@ -63,6 +64,7 @@ public class Job {
maxOutputNbLines = 0; maxOutputNbLines = 0;
updateRenderingStatusMethod = null; updateRenderingStatusMethod = null;
process = null; process = null;
askForRendererKill = false;
} }
@@ -110,6 +112,14 @@ public class Job {
return maxOutputNbLines; return maxOutputNbLines;
} }
public void setAskForRendererKill(boolean val) {
askForRendererKill = val;
}
public boolean getAskForRendererKill() {
return askForRendererKill;
}
public void setProcess(Process val) { public void setProcess(Process val) {
process = val; process = val;
} }

View File

@@ -129,6 +129,7 @@ public class Server extends Thread implements HostnameVerifier, X509TrustManager
// kill the current process, it will generate an error but it's okay // kill the current process, it will generate an error but it's okay
if (this.client != null && this.client.getRenderingJob() != null && this.client.getRenderingJob().getProcess() != null) { if (this.client != null && this.client.getRenderingJob() != null && this.client.getRenderingJob().getProcess() != null) {
OS.getOS().kill(this.client.getRenderingJob().getProcess()); OS.getOS().kill(this.client.getRenderingJob().getProcess());
this.client.getRenderingJob().setAskForRendererKill(true);
} }
} }
} }