diff --git a/api/agent/agent.go b/api/agent/agent.go index 83722d598..0670d9ae9 100644 --- a/api/agent/agent.go +++ b/api/agent/agent.go @@ -311,19 +311,19 @@ func (a *agent) handleCallEnd(ctx context.Context, call *call, slot Slot, err er statsStopRun(ctx) if err == nil { statsComplete(ctx) + } else if err == context.DeadlineExceeded { + statsTimedout(ctx) + return models.ErrCallTimeout } } else { statsDequeue(ctx) - if err == CapacityFull || err == context.DeadlineExceeded { + if err == models.ErrCallTimeoutServerBusy || err == context.DeadlineExceeded { statsTooBusy(ctx) return models.ErrCallTimeoutServerBusy } } - if err == context.DeadlineExceeded { - statsTimedout(ctx) - return models.ErrCallTimeout - } else if err == context.Canceled { + if err == context.Canceled { statsCanceled(ctx) } else if err != nil { statsErrors(ctx) @@ -487,7 +487,7 @@ func (a *agent) checkLaunch(ctx context.Context, call *call, caller slotCaller) notifyChans = a.evictor.PerformEviction(call.slotHashId, needMem, uint64(needCpu)) // For Non-blocking mode, if there's nothing to evict, we emit 503. if len(notifyChans) == 0 && isNB { - tryNotify(caller.notify, tok.Error()) + tryNotify(caller.notify, models.ErrCallTimeoutServerBusy) } } } else if a.shutWg.AddSession(1) { diff --git a/vendor/modules.txt b/vendor/modules.txt index 94cf513c2..2a4b8dcb6 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -196,8 +196,8 @@ go.opencensus.io # golang.org/x/crypto v0.0.0-20181015023909-0c41d7ab0a0e golang.org/x/crypto/ssh/terminal # golang.org/x/net v0.0.0-20181017193950-04a2e542c03f -golang.org/x/net/context golang.org/x/net/trace +golang.org/x/net/context golang.org/x/net/internal/timeseries golang.org/x/net/http2 golang.org/x/net/http2/hpack