Introduce FSHealthCheck to run after a possibly-filesystem related error.

This commit is contained in:
DaCool
2023-01-06 14:43:14 +00:00
committed by Sheepit Renderfarm
parent 68ad00334e
commit 9eed45ef6e
3 changed files with 101 additions and 1 deletions

View File

@@ -168,11 +168,14 @@ import okhttp3.HttpUrl;
}, this.configuration.getShutdownTime());
}
//send "error" log containing config
//send "error" log containing config and fs health check
step = log.newCheckPoint();
this.log.info("HWID: " + new HWIdentifier(log).getHardwareHash());
this.log.info("OS: " + OS.getOS().getVersion() + " " + System.getProperty("os.arch"));
this.log.info(configuration.toString());
for (String logline : configuration.filesystemHealthCheck()) {
this.log.info(logline);
}
sendError(step, null, Type.OK);
// Check integrity of all files in the working directories
@@ -756,6 +759,9 @@ import okhttp3.HttpUrl;
downloadRet = this.downloadExecutable(ajob);
if (downloadRet != Error.Type.OK) {
gui.setRenderingProjectName("");
for (String logline : configuration.filesystemHealthCheck()) {
log.debug(logline);
}
this.log.error("Client::work problem with downloadExecutable (ret " + downloadRet + ")");
return downloadRet;
}
@@ -763,6 +769,9 @@ import okhttp3.HttpUrl;
downloadRet = this.downloadSceneFile(ajob);
if (downloadRet != Error.Type.OK) {
gui.setRenderingProjectName("");
for (String logline : configuration.filesystemHealthCheck()) {
log.debug(logline);
}
this.log.error("Client::work problem with downloadSceneFile (ret " + downloadRet + ")");
return downloadRet;
}
@@ -770,12 +779,18 @@ import okhttp3.HttpUrl;
int ret = this.prepareWorkingDirectory(ajob); // decompress renderer and scene archives
if (ret != 0) {
gui.setRenderingProjectName("");
for (String logline : configuration.filesystemHealthCheck()) {
log.debug(logline);
}
this.log.error("Client::work problem with this.prepareWorkingDirectory (ret " + ret + ")");
return Error.Type.CAN_NOT_CREATE_DIRECTORY;
}
}
catch (FermeException e) {
gui.setRenderingProjectName("");
for (String logline : configuration.filesystemHealthCheck()) {
log.debug(logline);
}
if (e instanceof FermeExceptionNoSpaceLeftOnDevice) {
return Error.Type.NO_SPACE_LEFT_ON_DEVICE;
}
@@ -795,6 +810,9 @@ import okhttp3.HttpUrl;
if (scene_file.exists() == false) {
gui.setRenderingProjectName("");
for (String logline : configuration.filesystemHealthCheck()) {
log.debug(logline);
}
this.log.error("Client::work job preparation failed (scene file '" + scene_file.getAbsolutePath()
+ "' does not exist), cleaning directory in hope to recover");
this.configuration.cleanWorkingDirectory();
@@ -803,6 +821,9 @@ import okhttp3.HttpUrl;
if (renderer_file.exists() == false) {
gui.setRenderingProjectName("");
for (String logline : configuration.filesystemHealthCheck()) {
log.debug(logline);
}
this.log.error("Client::work job preparation failed (renderer file '" + renderer_file.getAbsolutePath()
+ "' does not exist), cleaning directory in hope to recover");
this.configuration.cleanWorkingDirectory();