From 4de029b3a8a172078060e2886eed5cc89760fbca Mon Sep 17 00:00:00 2001 From: Laurent Clouet Date: Tue, 2 Dec 2014 20:23:41 +0000 Subject: [PATCH] Bugfix: silent IOException because it's mostly due a process who is dead but its handle is still alive --- src/com/sheepit/client/Client.java | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/com/sheepit/client/Client.java b/src/com/sheepit/client/Client.java index 2d8864e..35c5ba3 100644 --- a/src/com/sheepit/client/Client.java +++ b/src/com/sheepit/client/Client.java @@ -550,17 +550,23 @@ public class Client { long last_update_status = 0; this.log.debug("renderer output"); - while ((line = input.readLine()) != null) { - nb_lines++; - this.updateRenderingMemoryPeak(line, ajob); - - this.log.debug(line); - if ((new Date().getTime() - last_update_status) > 2000) { // only call the update every two seconds - this.updateRenderingStatus(line, nb_lines, ajob); - last_update_status = new Date().getTime(); + try { + while ((line = input.readLine()) != null) { + nb_lines++; + this.updateRenderingMemoryPeak(line, ajob); + + //this.log.debug(line); + if ((new Date().getTime() - last_update_status) > 2000) { // only call the update every two seconds + this.updateRenderingStatus(line, nb_lines, ajob); + last_update_status = new Date().getTime(); + } } + input.close(); + } + catch (IOException err1) { // for the input.readline + // most likely The handle is invalid + this.log.error("Client:runRenderer exception(B) (silent error) " + err1); } - input.close(); this.log.debug("end of rendering"); } catch (Exception err) {