X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fws%2Fjws2%2FMsaWSThread.java;h=6ef07c60ec98ffdf2d597386d7dad3ee99a5281d;hb=a883b8a87fe965a1d04f67b6f82c985b0b2c8605;hp=86f5fbcebbc52796387e09f00738ff142244baf5;hpb=13e2ec04aa9db3447f2888c604d1479d0b901d56;p=jalview.git diff --git a/src/jalview/ws/jws2/MsaWSThread.java b/src/jalview/ws/jws2/MsaWSThread.java index 86f5fbc..6ef07c6 100644 --- a/src/jalview/ws/jws2/MsaWSThread.java +++ b/src/jalview/ws/jws2/MsaWSThread.java @@ -516,7 +516,7 @@ class MsaWSThread extends AWS2Thread implements WSClientI try { boolean cancelledJob = server.cancelJob(jobs[job].getJobId()); - if (cancelledJob || true) + if (true) // cancelledJob || true) { // CANCELLED_JOB // if the Jaba server indicates the job can't be cancelled, its @@ -594,9 +594,12 @@ class MsaWSThread extends AWS2Thread implements WSClientI .pullExecStatistics(j.getJobId(), lastchunk); if (chunk != null) { - changed=chunk.getChunk().length()>0; + changed|=chunk.getChunk().length()>0; response.append(chunk.getChunk()); lastchunk = chunk.getNextPosition(); + try { + Thread.sleep(50); + } catch (InterruptedException x){}; } ; } while (lastchunk >= 0 && j.getLastChunk() != lastchunk); @@ -737,12 +740,16 @@ class MsaWSThread extends AWS2Thread implements WSClientI MsaWSJob msjob = ((MsaWSJob) jobs[j]); if (jobs[j].isFinished() && msjob.alignment == null) { + int nunchanged=3,nexcept=3; boolean jpchanged=false,jpex=false; do { try { jpchanged = updateJobProgress(msjob); jpex=false; + if (jpchanged) { + nexcept=3; + } } catch (Exception e) { @@ -750,26 +757,24 @@ class MsaWSThread extends AWS2Thread implements WSClientI .warn("Exception when retrieving remaining Job progress data for job " + msjob.getJobId() + " on server " + WsUrl); e.printStackTrace(); - if (jpex) { - // give up polling after two consecutive exceptions - jpchanged=false; - } else { - jpchanged=true; - } + nexcept--; + nunchanged=3; // set flag remember that we've had an exception. jpex=true; + jpchanged=false; } - if (jpchanged) + if (!jpchanged) { try { - Thread.sleep(jpex ? 400 : 200); // wait a bit longer if we experienced an exception. + Thread.sleep(jpex ? 2400 : 1200); // wait a bit longer if we experienced an exception. } catch (Exception ex) { } ; - } - } while (jpchanged); + nunchanged--; + } + } while (nunchanged>0 && nexcept>0); if (Cache.log.isDebugEnabled()) { @@ -789,6 +794,9 @@ class MsaWSThread extends AWS2Thread implements WSClientI Cache.log .debug("Results not available for finished job - marking as broken job.", e); + msjob.jobProgress + .append("\nResult not available. Probably due to invalid input or parameter settings. Server error message below:\n\n" + + e.getLocalizedMessage()); msjob.setjobStatus(JobStatus.FAILED); } catch (Exception e) {