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

    https://github.com/apache/flink/pull/2451#discussion_r77337006
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/rpc/resourcemanager/ResourceManager.java
 ---
    @@ -138,22 +150,46 @@ public SlotAssignment requestSlot(SlotRequest 
slotRequest) {
     
     
        /**
    -    *
    -    * @param resourceManagerLeaderId  The fencing token for the 
ResourceManager leader 
    +    * Register a taskExecutor at the resource manager
    +    * @param resourceManagerLeaderId  The fencing token for the 
ResourceManager leader
         * @param taskExecutorAddress      The address of the TaskExecutor that 
registers
         * @param resourceID               The resource ID of the TaskExecutor 
that registers
         *
         * @return The response by the ResourceManager.
         */
        @RpcMethod
    -   public org.apache.flink.runtime.rpc.registration.RegistrationResponse 
registerTaskExecutor(
    -                   UUID resourceManagerLeaderId,
    -                   String taskExecutorAddress,
    -                   ResourceID resourceID) {
    +   public Future<RegistrationResponse> registerTaskExecutor(
    +           final UUID resourceManagerLeaderId,
    +           final String taskExecutorAddress,
    +           final ResourceID resourceID) {
    +
    +           if(!leaderSessionID.equals(resourceManagerLeaderId)) {
    +                   log.warn("Discard registration from TaskExecutor {} at 
({}) because the expected leader session ID {} did not equal the received 
leader session ID  {}",
    +                           resourceID, taskExecutorAddress, 
leaderSessionID, resourceManagerLeaderId);
    +                   return Futures.failed(new 
UnmatchedLeaderSessionIDException(leaderSessionID, resourceManagerLeaderId));
    --- End diff --
    
    Should we fail or decline the registration here? So either sending an 
exception or a `RegistrationResponse.Decline` message.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to