wilfred-s commented on a change in pull request #261:
URL:
https://github.com/apache/incubator-yunikorn-core/pull/261#discussion_r601938934
##########
File path: pkg/scheduler/objects/application.go
##########
@@ -266,12 +266,29 @@ func (sa *Application) timeoutPlaceholderProcessing() {
defer sa.Unlock()
switch {
// Case 1: if all app's placeholders are allocated, only part of them
gets replaced, just delete the remaining placeholders
- case (sa.IsRunning() || sa.IsStarting()) &&
!resources.IsZero(sa.allocatedPlaceholder):
+ case (sa.IsRunning() || sa.IsStarting() || sa.IsCompleting()) &&
!resources.IsZero(sa.allocatedPlaceholder):
Review comment:
starting point of both cases:
- enter _Completing_ state, placeholder allocated
- placeholder timeout triggered: release all non replaced placeholder
case 1:
- in _Completing_, timeout placeholder triggered
- earlier replaced placeholder allocation is confirmed released by the shim,
allocation is swapped
- application returns to _Running_
- --> placeholders that are timed out get removed
- --> placeholders that were replaced get swapped and app runs to a normal
finish. All based on the shim responses
case 2:
- in _Completing_, timeout placeholder triggered
- no placeholder releases are confirmed
- _Completing_ timeout triggered, all placeholder will be released (again)
- wait for all placeholders to be released, all timers are cleaned up
(existing behaviour)
- --> placeholders that are timed out get removed
- --> placeholders that were replaced get swapped and app runs to a normal
finish. All based on the shim responses
- --> if all placeholders are removed and the app has not transitioned back
to _Running_ it will transition to _Completed_
And yes in case it might happen that an original replacement request comes
back before the second release requested. This is not a problem as that just
simply triggers a change back into _Running_ for the app. All placeholders will
be released either as a replacement or just a simple release. Changing the
_Completing_ to _Completed_ transition itself is not what
--
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]