/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
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
{
StringBuffer response = j.jobProgress;
long lastchunk = j.getLastChunk();
- boolean changed=false;
+ boolean changed = false;
do
{
j.setLastChunk(lastchunk);
.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);
}
else if (j.hasArguments())
{
- j.setJobId(server.customAlign(j.seqs,j.getJabaArguments()));
+ j.setJobId(server.customAlign(j.seqs, j.getJabaArguments()));
}
else
{
public void parseResult()
{
+ long progbar = System.currentTimeMillis();
+ wsInfo.setProgressBar("Collecting job results.", progbar);
int results = 0; // number of result sets received
JobStateSummary finalState = new JobStateSummary();
try
MsaWSJob msjob = ((MsaWSJob) jobs[j]);
if (jobs[j].isFinished() && msjob.alignment == null)
{
- boolean jpchanged=false,jpex=false;
- do {
+ int nunchanged = 3, nexcept = 3;
+ boolean jpchanged = false, jpex = false;
+ do
+ {
try
{
jpchanged = updateJobProgress(msjob);
- jpex=false;
+ jpex = false;
+ if (jpchanged)
+ {
+ nexcept = 3;
+ }
} catch (Exception e)
{
-
+
Cache.log
.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;
+ 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)
{
}
;
+ nunchanged--;
}
- } while (jpchanged);
-
+ } while (nunchanged > 0 && nexcept > 0);
+
if (Cache.log.isDebugEnabled())
{
System.out.println("Job Execution file for job: "
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)
{
}
else
{
- wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_ERROR);
wsInfo.setFinishedNoResults();
}
+ updateGlobalStatus(finalState);
+ wsInfo.setProgressBar(null, progbar);
}
void displayResults(boolean newFrame)