azagrebin opened a new pull request #8988: [FLINK-12736][coordination] Release 
TaskExecutor in SlotManager if no slot allocations after partition check
URL: https://github.com/apache/flink/pull/8988
 
 
   ## What is the purpose of the change
   
   The ResourceManager looks out for TaskManagers that have not had any slots 
allocated on them for a while, as these could be released to safe resources. If 
such a TM is found, the RM checks via an RPC call whether the TM still holds 
any partitions. If no partition is held then the TM is released. However, in 
the RPC callback no check is made whether the TM is actually still idle. In the 
meantime a slot could have been allocated on the TM. Even if the slot has been 
freed, there can be newly allocated partitions not included in check result.
   
   To make sure there was no resource allocation in between, we can mark the 
`taskManagerRegistration.getIdleSince()` time before starting the async 'no 
partition' check. The TM can be released only if the idle time after the check 
matches the previously marked one. Otherwise we discard the release and start 
over after the next timeout.
   
   ## Brief change log
   
     - mark the TM idle time before `canBeReleased` check in 
`SlotManager.checkTaskManagerTimeouts`
     - check it after the `canBeReleased` check and release only if it coincides
     - modify `SlotManagerTest.testTaskManagerNotReleasedBeforeItCanBe` to 
check that TM is not released if there was allocation between triggering of 
`canBeReleased` check and completing it
   
   ## Verifying this change
   
   run `SlotManagerTest.testTaskManagerNotReleasedBeforeItCanBe`
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: (no)
     - The serializers: (no)
     - The runtime per-record code paths (performance sensitive): (no)
     - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Yarn/Mesos, ZooKeeper: (no)
     - The S3 file system connector: (no)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (no)
     - If yes, how is the feature documented? (not applicable)
   

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