Instead of giving generic no job status, the server now give more detailed status
This commit is contained in:
@@ -90,6 +90,8 @@ where X:
|
|||||||
* 202 => Client's session is dead. Client should do a config request before requesting a new job.
|
* 202 => Client's session is dead. Client should do a config request before requesting a new job.
|
||||||
* 203 => Client's session have been disabled (usually because the client is sending broken frame). The client warms the end user and logout.
|
* 203 => Client's session have been disabled (usually because the client is sending broken frame). The client warms the end user and logout.
|
||||||
* 205 => No renderer is available for Client's hardware (pair of OS and architecture). For example Blender is not available for MacOS 32bits.
|
* 205 => No renderer is available for Client's hardware (pair of OS and architecture). For example Blender is not available for MacOS 32bits.
|
||||||
|
* 206 => Server is in maintenance mode, it will not give frame to do (but it will keep the session alive).
|
||||||
|
* 207 => Server is too busy to run the scheduler, it will not give frame to do (but it will keep the session alive).
|
||||||
* something else => unknown error
|
* something else => unknown error
|
||||||
|
|
||||||
Answer with no error:
|
Answer with no error:
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ import com.sheepit.client.Error.Type;
|
|||||||
import com.sheepit.client.exception.FermeException;
|
import com.sheepit.client.exception.FermeException;
|
||||||
import com.sheepit.client.exception.FermeExceptionNoRightToRender;
|
import com.sheepit.client.exception.FermeExceptionNoRightToRender;
|
||||||
import com.sheepit.client.exception.FermeExceptionNoSession;
|
import com.sheepit.client.exception.FermeExceptionNoSession;
|
||||||
|
import com.sheepit.client.exception.FermeExceptionServerInMaintenance;
|
||||||
|
import com.sheepit.client.exception.FermeExceptionServerOverloaded;
|
||||||
import com.sheepit.client.exception.FermeExceptionSessionDisabled;
|
import com.sheepit.client.exception.FermeExceptionSessionDisabled;
|
||||||
import com.sheepit.client.exception.FermeServerDown;
|
import com.sheepit.client.exception.FermeServerDown;
|
||||||
import com.sheepit.client.os.OS;
|
import com.sheepit.client.os.OS;
|
||||||
@@ -220,6 +222,30 @@ public class Client {
|
|||||||
}
|
}
|
||||||
continue; // go back to ask job
|
continue; // go back to ask job
|
||||||
}
|
}
|
||||||
|
catch (FermeExceptionServerOverloaded e) {
|
||||||
|
int wait = 15;
|
||||||
|
int time_sleep = 1000 * 60 * wait;
|
||||||
|
this.gui.status(String.format("Server is overloaded and cannot give frame to render. Will retry in %s minutes", wait));
|
||||||
|
try {
|
||||||
|
Thread.sleep(time_sleep);
|
||||||
|
}
|
||||||
|
catch (InterruptedException e1) {
|
||||||
|
return -3;
|
||||||
|
}
|
||||||
|
continue; // go back to ask job
|
||||||
|
}
|
||||||
|
catch (FermeExceptionServerInMaintenance e) {
|
||||||
|
int wait = 15;
|
||||||
|
int time_sleep = 1000 * 60 * wait;
|
||||||
|
this.gui.status(String.format("Server is in maintenance and cannot give frame to render. Will retry in %s minutes", wait));
|
||||||
|
try {
|
||||||
|
Thread.sleep(time_sleep);
|
||||||
|
}
|
||||||
|
catch (InterruptedException e1) {
|
||||||
|
return -3;
|
||||||
|
}
|
||||||
|
continue; // go back to ask job
|
||||||
|
}
|
||||||
catch (FermeException e) {
|
catch (FermeException e) {
|
||||||
this.gui.error("Client::renderingManagement exception requestJob (1) " + e.getMessage());
|
this.gui.error("Client::renderingManagement exception requestJob (1) " + e.getMessage());
|
||||||
StringWriter sw = new StringWriter();
|
StringWriter sw = new StringWriter();
|
||||||
|
|||||||
2
src/com/sheepit/client/Error.java
Normal file → Executable file
2
src/com/sheepit/client/Error.java
Normal file → Executable file
@@ -72,6 +72,8 @@ public class Error {
|
|||||||
JOB_REQUEST_ERROR_SESSION_DISABLED(203),
|
JOB_REQUEST_ERROR_SESSION_DISABLED(203),
|
||||||
JOB_REQUEST_ERROR_INTERNAL_ERROR(204),
|
JOB_REQUEST_ERROR_INTERNAL_ERROR(204),
|
||||||
JOB_REQUEST_ERROR_RENDERER_NOT_AVAILABLE(205),
|
JOB_REQUEST_ERROR_RENDERER_NOT_AVAILABLE(205),
|
||||||
|
JOB_REQUEST_SERVER_IN_MAINTENANCE(206),
|
||||||
|
JOB_REQUEST_SERVER_OVERLOADED(207),
|
||||||
|
|
||||||
JOB_VALIDATION_ERROR_MISSING_PARAMETER(300),
|
JOB_VALIDATION_ERROR_MISSING_PARAMETER(300),
|
||||||
JOB_VALIDATION_ERROR_BROKEN_MACHINE(301), // in GPU the generated frame is black
|
JOB_VALIDATION_ERROR_BROKEN_MACHINE(301), // in GPU the generated frame is black
|
||||||
|
|||||||
@@ -77,6 +77,8 @@ import com.sheepit.client.Error.ServerCode;
|
|||||||
import com.sheepit.client.exception.FermeException;
|
import com.sheepit.client.exception.FermeException;
|
||||||
import com.sheepit.client.exception.FermeExceptionNoRightToRender;
|
import com.sheepit.client.exception.FermeExceptionNoRightToRender;
|
||||||
import com.sheepit.client.exception.FermeExceptionNoSession;
|
import com.sheepit.client.exception.FermeExceptionNoSession;
|
||||||
|
import com.sheepit.client.exception.FermeExceptionServerInMaintenance;
|
||||||
|
import com.sheepit.client.exception.FermeExceptionServerOverloaded;
|
||||||
import com.sheepit.client.exception.FermeExceptionSessionDisabled;
|
import com.sheepit.client.exception.FermeExceptionSessionDisabled;
|
||||||
import com.sheepit.client.exception.FermeServerDown;
|
import com.sheepit.client.exception.FermeServerDown;
|
||||||
import com.sheepit.client.os.OS;
|
import com.sheepit.client.os.OS;
|
||||||
@@ -330,6 +332,12 @@ public class Server extends Thread implements HostnameVerifier, X509TrustManager
|
|||||||
else if (ret == ServerCode.JOB_REQUEST_ERROR_SESSION_DISABLED) {
|
else if (ret == ServerCode.JOB_REQUEST_ERROR_SESSION_DISABLED) {
|
||||||
throw new FermeExceptionSessionDisabled();
|
throw new FermeExceptionSessionDisabled();
|
||||||
}
|
}
|
||||||
|
else if (ret == ServerCode.JOB_REQUEST_SERVER_IN_MAINTENANCE) {
|
||||||
|
throw new FermeExceptionServerInMaintenance();
|
||||||
|
}
|
||||||
|
else if (ret == ServerCode.JOB_REQUEST_SERVER_OVERLOADED) {
|
||||||
|
throw new FermeExceptionServerOverloaded();
|
||||||
|
}
|
||||||
this.log.error("Server::requestJob: Utils.statusIsOK(document, 'jobrequest') -> ret " + ret);
|
this.log.error("Server::requestJob: Utils.statusIsOK(document, 'jobrequest') -> ret " + ret);
|
||||||
throw new FermeException("error requestJob: status is not ok (it's " + ret + ")");
|
throw new FermeException("error requestJob: status is not ok (it's " + ret + ")");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.sheepit.client.exception;
|
||||||
|
|
||||||
|
public class FermeExceptionServerInMaintenance extends FermeException {
|
||||||
|
public FermeExceptionServerInMaintenance() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public FermeExceptionServerInMaintenance(String message_) {
|
||||||
|
super(message_);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.sheepit.client.exception;
|
||||||
|
|
||||||
|
public class FermeExceptionServerOverloaded extends FermeException {
|
||||||
|
public FermeExceptionServerOverloaded() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public FermeExceptionServerOverloaded(String message_) {
|
||||||
|
super(message_);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user