Skip to content

Commit

Permalink
srm: fix status of all-failed container jobs
Browse files Browse the repository at this point in the history
The status of a container job is updated as a side-effect of running
the ContainerRequest#getRequestStatus method.  Unfortunately, if
all the file requests have failed then a very long, multi-line
status is recorded, which includes a copy of the previous
status.

This patch fixes the status so that, even under these circumstances,
the status line is a short string.

Target: master
Requires-notes: no
Requires-book: no
  • Loading branch information
paulmillar committed Jul 3, 2014
1 parent 908ae5a commit ff2397f
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -403,10 +403,16 @@ public final RequestStatus getRequestStatus() {
// no running, no ready and no pending requests
// there are only failed requests
// we can fail this request

// REVISIT: the above logic seems flawed: this branch is reached
// if there are multiple file requests, some in state
// Done and others in state Failed. The behaviour may
// be correct, but should be checked.

rs.state = "Failed";
try
{
setState(State.FAILED, rs.errorMessage);
setState(State.FAILED, "File requests have failed.");
stopUpdating();
}
catch(IllegalStateTransition ist)
Expand All @@ -417,7 +423,7 @@ public final RequestStatus getRequestStatus() {
// all requests are done
try
{
setState(State.DONE,"All files are done.");
setState(State.DONE, "All file requests succeeded.");
stopUpdating();
}
catch(IllegalStateTransition ist)
Expand Down

0 comments on commit ff2397f

Please sign in to comment.