yangwwei commented on pull request #250:
URL:
https://github.com/apache/incubator-yunikorn-core/pull/250#issuecomment-782574418
hi @kingamarton one thing Wilfred and I discussed was maybe we can leverage
the rmEventHandler in the app object to trigger the placeholder clean up. Here
is a rough idea:
```
pp state: WAITING
- 30s passed (the timeout handler, do not directly transit to Completed)
- send a event to rmEventHandler
sa.rmEventHandler.HandleEvent(
&rmevent.RMPartitionAppCompleteEvent{
RmID: sa.rmID,
CompletedApps: app,
})
scheduler#handleRMEvent()
- case *rmevent.RMPartitionAppCompleteEvent:
s.clusterContext.beforeAppComplete(v)
context#beforeAppComplete()
partition#handleAppCompletion()
// remove placeholders
// notify the shim
// when the core gets confirmation from the shim
// it calls this function to remove existing allocations for the placeholders
app#removeAllocationInternal()
// when there is no placeholders left, no pending resources, nor ask
sa.HandleApplicationEvent(CompleteApplication)
```
please take a look at this approach and let me know if this makes sense.
With this approach, we make sure the core gets the confirmation from the
shim that all placeholders are removed before moving the app to the Completed
state. So it can avoid the situation where the app is Completed, but somehow
placeholders were not completed removed.
----------------------------------------------------------------
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]