Skip to content

Commit

Permalink
Fixed dump last queue status on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
pditommaso committed Nov 14, 2018
1 parent 07fcfbb commit 36e8024
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/main/groovy/nextflow/executor/AbstractGridExecutor.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ abstract class AbstractGridExecutor extends Executor {

private final static List<String> INVALID_NAME_CHARS = [ " ", "/", ":", "@", "*", "?", "\\n", "\\t", "\\r" ]

private Map lastQueueStatus

/**
* Initialize the executor class
*/
Expand Down Expand Up @@ -289,7 +291,7 @@ abstract class AbstractGridExecutor extends Executor {
}

@PackageScope
String dumpQueueStatus(Map<String,QueueStatus> statusMap) {
final String dumpQueueStatus(Map<String,QueueStatus> statusMap) {
if( statusMap == null )
return ' (null)'
if( statusMap.isEmpty() )
Expand All @@ -302,6 +304,11 @@ abstract class AbstractGridExecutor extends Executor {
return result.toString()
}

@PackageScope
final String dumpQueueStatus() {
dumpQueueStatus(lastQueueStatus)
}

/**
* @param queue The command for which the status of jobs has be to read
* @return The command line to be used to retried the job statuses
Expand All @@ -322,7 +329,7 @@ abstract class AbstractGridExecutor extends Executor {
* @return {@code true} if the job is in RUNNING or HOLD status, or even if it is temporarily unable
* to retrieve the job status for some
*/
public boolean checkActiveStatus( jobId, queue ) {
boolean checkActiveStatus( jobId, queue ) {
assert jobId

// -- fetch the queue status
Expand All @@ -331,6 +338,8 @@ abstract class AbstractGridExecutor extends Executor {
log.trace "[${name.toUpperCase()}] queue ${queue?"($queue) ":''}status >\n" + dumpQueueStatus(result)
return result
}
// track the last status for debugging purpose
lastQueueStatus = status

if( status == null ) { // no data is returned, so return true
return true
Expand Down

0 comments on commit 36e8024

Please sign in to comment.