Skip to content

Commit

Permalink
Another experimental improvement: when Globus API reports that the task
Browse files Browse the repository at this point in the history
status is "ACTIVE", take it seriously/literally. #11057
  • Loading branch information
landreev committed Dec 28, 2024
1 parent f9e90e9 commit 2933b77
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/main/java/edu/harvard/iq/dataverse/api/Datasets.java
Original file line number Diff line number Diff line change
Expand Up @@ -4018,7 +4018,7 @@ public Response requestGlobusUpload(@Context ContainerRequestContext crc, @PathP
case 400:
return badRequest("Unable to grant permission");
case 409:
return conflict("Permission already exists");
return conflict("Permission already exists or no more permissions allowed");
default:
return error(null, "Unexpected error when granting permission");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -797,8 +797,8 @@ public void globusUpload(JsonObject jsonData, Dataset dataset, String httpReques
String logFileName = System.getProperty("com.sun.aas.instanceRoot")
+ File.separator + "logs"
+ File.separator + "globus" + GlobusTaskInProgress.TaskType.UPLOAD + "_"
+ logTimestamp + " " + dataset.getId() + "_"
+ ".log";
+ logTimestamp + "_" + dataset.getId()
+ ".log";
FileHandler fileHandler;

try {
Expand Down Expand Up @@ -1251,7 +1251,7 @@ public void globusDownload(JsonObject jsonObject, Dataset dataset, User authUser
String logFileName = System.getProperty("com.sun.aas.instanceRoot")
+ File.separator + "logs"
+ File.separator + "globus" + GlobusTaskInProgress.TaskType.DOWNLOAD + "_"
+ dataset.getId() + "_" + logTimestamp
+ logTimestamp + "_" + dataset.getId()
+ ".log";
FileHandler fileHandler;
boolean fileHandlerSuceeded;
Expand Down
14 changes: 10 additions & 4 deletions src/main/java/edu/harvard/iq/dataverse/globus/GlobusUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,20 @@ public static boolean isTaskCompleted(GlobusTaskState task) {
// that it's a Globus issue on the endnode side, that is
// in fact recoverable; should we add it to the list here?
// @todo: I'm tempted to just take "ACTIVE" for face value,
// and ALWAYS assume that it's still ongoing.
if (task.getNice_status().equalsIgnoreCase("ok")
|| task.getNice_status().equalsIgnoreCase("queued")) {
// and ALWAYS assume that the task is still ongoing.
/*if (task.getNice_status().equalsIgnoreCase("ok")
|| task.getNice_status().equalsIgnoreCase("queued")) {*/
return false;
}
// further @todo: maybe only use this "strict" interpretation
// of what "ACTIVE" means when the "experimental" (async.)
// monitoring mode is enabled?
/*}*/
}
}
}
// @todo: if either task, or status is null - it may indicate that there
// was an error contacting the task management api, not that it has
// completed one way or another - ?
return true;
}

Expand Down

0 comments on commit 2933b77

Please sign in to comment.