Skip to content

Commit

Permalink
[YUNIKORN-579] Handle release allocation/ask events under Failing sta…
Browse files Browse the repository at this point in the history
…te (#244)
  • Loading branch information
kingamarton authored and yangwwei committed Mar 18, 2021
1 parent d31b87e commit 1b25b2c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 6 additions & 0 deletions pkg/cache/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,15 @@ func NewApplication(appID, queueName, user string, tags map[string]string, sched
{Name: string(events.ReleaseAppAllocation),
Src: []string{states.Running},
Dst: states.Running},
{Name: string(events.ReleaseAppAllocation),
Src: []string{states.Failed},
Dst: states.Failed},
{Name: string(events.ReleaseAppAllocationAsk),
Src: []string{states.Running, states.Accepted, states.Reserving},
Dst: states.Running},
{Name: string(events.ReleaseAppAllocationAsk),
Src: []string{states.Failed},
Dst: states.Failed},
{Name: string(events.CompleteApplication),
Src: []string{states.Running},
Dst: states.Completed},
Expand Down
3 changes: 1 addition & 2 deletions pkg/callback/scheduler_callback.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ func (callback *AsyncRMCallback) RecvUpdateResponse(response *si.UpdateResponse)
log.Logger().Debug("callback: response to released allocations",
zap.String("allocation key", ask.Allocationkey))

// TerminationType 0 mean STOPPED_BY_RM
if ask.TerminationType == si.TerminationType_TIMEOUT {
ev := cache.NewReleaseAppAllocationAskEvent(ask.ApplicationID, ask.TerminationType, ask.Allocationkey)
dispatcher.Dispatch(ev)
Expand All @@ -150,7 +149,7 @@ func (callback *AsyncRMCallback) RecvUpdateResponse(response *si.UpdateResponse)
log.Logger().Error("failed to delete application", zap.Error(err))
}
} else {
if updated.State == events.States().Application.Killed {
if updated.State == "Failing" || updated.State == events.States().Application.Failed {
ev := cache.NewFailApplicationEvent(updated.ApplicationID)
dispatcher.Dispatch(ev)
}
Expand Down

0 comments on commit 1b25b2c

Please sign in to comment.