Instead of giving generic no job status, the server now give more detailed status
This commit is contained in:
@@ -35,6 +35,8 @@ import com.sheepit.client.Error.Type;
|
||||
import com.sheepit.client.exception.FermeException;
|
||||
import com.sheepit.client.exception.FermeExceptionNoRightToRender;
|
||||
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.FermeServerDown;
|
||||
import com.sheepit.client.os.OS;
|
||||
@@ -220,6 +222,30 @@ public class Client {
|
||||
}
|
||||
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) {
|
||||
this.gui.error("Client::renderingManagement exception requestJob (1) " + e.getMessage());
|
||||
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_INTERNAL_ERROR(204),
|
||||
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_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.FermeExceptionNoRightToRender;
|
||||
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.FermeServerDown;
|
||||
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) {
|
||||
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);
|
||||
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