yanghua commented on a change in pull request #10014: [FLINK-12526] Remove 
STATE_UPDATER in ExecutionGraph
URL: https://github.com/apache/flink/pull/10014#discussion_r340008288
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java
 ##########
 @@ -1362,16 +1356,12 @@ private boolean transitionState(JobStatus current, 
JobStatus newState, Throwable
                }
 
                // now do the actual state transition
-               if (STATE_UPDATER.compareAndSet(this, current, newState)) {
-                       LOG.info("Job {} ({}) switched from state {} to {}.", 
getJobName(), getJobID(), current, newState, error);
+               state = newState;
+               LOG.info("Job {} ({}) switched from state {} to {}.", 
getJobName(), getJobID(), current, newState, error);
 
-                       stateTimestamps[newState.ordinal()] = 
System.currentTimeMillis();
-                       notifyJobStatusChange(newState, error);
-                       return true;
-               }
-               else {
-                       return false;
-               }
+               stateTimestamps[newState.ordinal()] = 
System.currentTimeMillis();
+               notifyJobStatusChange(newState, error);
+               return true;
 
 Review comment:
   You are right. I have updated the PR. What do you think about the new change?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to