Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2657#discussion_r84573433
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/ResourceManager.java
 ---
    @@ -471,6 +498,149 @@ public void shutDownCluster(final ApplicationStatus 
finalStatus, final String op
        }
     
        // 
------------------------------------------------------------------------
    +   //  Testing methods
    +   // 
------------------------------------------------------------------------
    +
    +   /**
    +    * Gets the leader session id of current resourceManager.
    +    *
    +    * @return return the leaderSessionId of current resourceManager, this 
returns null until the current resourceManager is granted leadership.
    +    */
    +   @VisibleForTesting
    +   UUID getLeaderSessionId() {
    +           return leaderSessionId;
    +   }
    +
    +   // 
------------------------------------------------------------------------
    +   //  Internal methods
    +   // 
------------------------------------------------------------------------
    +
    +   private void clearState() {
    +           jobManagerRegistrations.clear();
    +           taskExecutors.clear();
    +           slotManager.clearState();
    +
    +           try {
    +                   jobLeaderIdService.clear();
    +           } catch (Exception e) {
    +                   onFatalError(new ResourceManagerException("Could not 
properly clear the job leader id service.", e));
    +           }
    +
    +           leaderSessionId = new UUID(0, 0);
    --- End diff --
    
    You're right. Yes this should be `null`. I want to change the current 
behaviour that we don't use `null` in the standalone case. Instead, `null` 
should indicate that there is no leader.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to