zentol commented on a change in pull request #14963:
URL: https://github.com/apache/flink/pull/14963#discussion_r580300575



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/AdaptiveScheduler.java
##########
@@ -911,19 +914,26 @@ public void runIfState(State expectedState, Runnable 
action, Duration delay) {
 
     // ----------------------------------------------------------------
 
+    /** Note: Do not call this method from a State constructor. */
     @VisibleForTesting
-    void transitionToState(State newState) {
-        if (state != newState) {
+    void transitionToState(StateFactory<?> targetState) {
+        Preconditions.checkState(
+                !isTransitioningState, "Concurrent state transitions are not 
allowed");

Review comment:
       I'm wondering if "concurrent" is the right word; to me it usually 
implies threading issues and such.
   
   How about "State transitions must not be triggered while another state 
transition is in progress."




----------------------------------------------------------------
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]


Reply via email to