mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
fn: pure-runner time out while waiting TryCall (#1006)
This should return a retriable error code 503.
This commit is contained in:
@@ -23,9 +23,11 @@ import (
|
||||
"github.com/golang/protobuf/ptypes/empty"
|
||||
"github.com/sirupsen/logrus"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/credentials"
|
||||
"google.golang.org/grpc/metadata"
|
||||
"google.golang.org/grpc/peer"
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
/*
|
||||
@@ -420,6 +422,10 @@ func (ch *callHandle) getTryMsg() *runner.TryCall {
|
||||
select {
|
||||
case <-ch.doneQueue:
|
||||
case <-ch.ctx.Done():
|
||||
// if ctx timed out while waiting, then this is a 503 (retriable)
|
||||
err := status.Errorf(codes.Code(models.ErrCallTimeoutServerBusy.Code()), models.ErrCallTimeoutServerBusy.Error())
|
||||
ch.shutdown(err)
|
||||
return nil
|
||||
case item := <-ch.inQueue:
|
||||
if item != nil {
|
||||
msg = item.GetTry()
|
||||
|
||||
Reference in New Issue
Block a user