fn: blocking mode should not emit 503 if can't evict (#1283)

This commit is contained in:
Tolga Ceylan
2018-10-25 12:17:26 -07:00
committed by GitHub
parent 5228269e15
commit 241d3fede1

View File

@@ -494,7 +494,8 @@ func (a *agent) checkLaunch(ctx context.Context, call *call, notifyChan chan err
} else {
needMem, needCpu := tok.NeededCapacity()
notifyChans = a.evictor.PerformEviction(call.slotHashId, needMem, uint64(needCpu))
if len(notifyChans) == 0 {
// For Non-blocking mode, if there's nothing to evict, we emit 503.
if len(notifyChans) == 0 && isNB {
tryNotify(notifyChan, tok.Error())
}
}