From 433ed5ed74acf6a8af982d6c283a2018212cab56 Mon Sep 17 00:00:00 2001 From: Luis Uguina Date: Wed, 15 Apr 2020 17:40:51 +1000 Subject: [PATCH] fix: background uploads queuing not working properly (#209) Fix the sync/async detection to ensure that handle the server side projects properly. The routine was incorrectly uploading sync files with the async routine and vice-versa. --- src/com/sheepit/client/Client.java | 2 +- src/com/sheepit/client/standalone/Worker.java | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/com/sheepit/client/Client.java b/src/com/sheepit/client/Client.java index a3bc066..3c38228 100644 --- a/src/com/sheepit/client/Client.java +++ b/src/com/sheepit/client/Client.java @@ -323,7 +323,7 @@ public class Client { continue; } - if (this.renderingJob.isSynchronousUpload() == false) { // power or compute_method job, need to upload right away + if (this.renderingJob.isSynchronousUpload() == true) { // power or compute_method job, need to upload right away ret = confirmJob(this.renderingJob); if (ret != Error.Type.OK) { gui.error("Client::run problem with confirmJob (returned " + ret + ")"); diff --git a/src/com/sheepit/client/standalone/Worker.java b/src/com/sheepit/client/standalone/Worker.java index 91ff585..b168e42 100644 --- a/src/com/sheepit/client/standalone/Worker.java +++ b/src/com/sheepit/client/standalone/Worker.java @@ -58,9 +58,6 @@ public class Worker { @Option(name = "-cache-dir", usage = "Cache/Working directory. Caution, everything in it not related to the render-farm will be removed", metaVar = "/tmp/cache", required = false) private String cache_dir = null; - @Option(name = "-max-uploading-job", usage = "", metaVar = "1", required = false) - private int max_upload = -1; - @Option(name = "-gpu", usage = "Name of the GPU used for the render, for example CUDA_0 for Nvidia or OPENCL_0 for AMD/Intel card", metaVar = "CUDA_0", required = false) private String gpu_device = null; @@ -147,13 +144,12 @@ public class Worker { } } - if (max_upload != -1) { - if (max_upload <= 0) { - System.err.println("Error: max upload should be a greater than zero"); - return; - } - config.setMaxUploadingJob(max_upload); - } + // We set a hard limit of 3 concurrent uploads. As the server doesn't allocate more than 3 concurrent jobs to + // a single session to avoid any client taking too many frames and not validating them, we throttle the uploads. + // If we don't set this limit, in a computer with slow uploads the server will return a "no job available" when + // the 4th concurrent job is requested and that will put the client in "wait" mode for some random time. To + // avoid that situation we set this limit. + config.setMaxUploadingJob(3); if (gpu_device != null) { if (gpu_device.startsWith(Nvidia.TYPE) == false && gpu_device.startsWith(OpenCL.TYPE) == false) {