Skip to content

Commit

Permalink
Fix a missing field update in Job.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalohlava committed Jun 3, 2015
1 parent fb4a82d commit c7892ce
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion h2o-core/src/main/java/water/Job.java
Expand Up @@ -226,7 +226,7 @@ private void changeJobState(final String msg, final JobState resultingState) {
assert resultingState != JobState.RUNNING;
if( _state == JobState.CANCELLED ) Log.info("Canceled job " + _key + "(" + _description + ") was cancelled again.");
if( _state == resultingState ) return; // No change if already done
_finalProgress = resultingState==JobState.DONE ? 1.0f : progress_impl(); // One-shot set from NaN to progress, no longer need Progress Key
final float finalProgress = resultingState==JobState.DONE ? 1.0f : progress_impl(); // One-shot set from NaN to progress, no longer need Progress Key
final long done = System.currentTimeMillis();
// Atomically flag the job as canceled
new TAtomic<Job>() {
Expand All @@ -238,6 +238,7 @@ private void changeJobState(final String msg, final JobState resultingState) {
old._exception = msg;
old._state = resultingState;
old._end_time = done;
old._finalProgress = finalProgress;
return old;
}
// Run the onCancelled code synchronously, right now
Expand All @@ -249,6 +250,7 @@ private void changeJobState(final String msg, final JobState resultingState) {
_exception = msg;
_state = resultingState;
_end_time = done;
_finalProgress = finalProgress;
}
// Remove on cancel/fail/done, only used whilst Job is Running
if (deleteProgressKey())
Expand Down

0 comments on commit c7892ce

Please sign in to comment.