fn: lb-agent & runner gRPC updates (#1005)

Breaking changes:

*) Removed unused ACK/NACK definitions
*) Extended Finished messages with error code/str
This commit is contained in:
Tolga Ceylan
2018-05-17 15:02:15 -07:00
committed by GitHub
parent 7cf8e2a61d
commit 77086ecc24
4 changed files with 104 additions and 174 deletions

View File

@@ -9,7 +9,6 @@ It is generated from these files:
It has these top-level messages: It has these top-level messages:
TryCall TryCall
CallAcknowledged
DataFrame DataFrame
HttpHeader HttpHeader
HttpRespMeta HttpRespMeta
@@ -59,39 +58,6 @@ func (m *TryCall) GetModelsCallJson() string {
return "" return ""
} }
// Call has been accepted and a slot allocated, or it's been rejected
type CallAcknowledged struct {
Committed bool `protobuf:"varint,1,opt,name=committed" json:"committed,omitempty"`
Details string `protobuf:"bytes,2,opt,name=details" json:"details,omitempty"`
SlotAllocationLatency string `protobuf:"bytes,3,opt,name=slot_allocation_latency,json=slotAllocationLatency" json:"slot_allocation_latency,omitempty"`
}
func (m *CallAcknowledged) Reset() { *m = CallAcknowledged{} }
func (m *CallAcknowledged) String() string { return proto.CompactTextString(m) }
func (*CallAcknowledged) ProtoMessage() {}
func (*CallAcknowledged) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
func (m *CallAcknowledged) GetCommitted() bool {
if m != nil {
return m.Committed
}
return false
}
func (m *CallAcknowledged) GetDetails() string {
if m != nil {
return m.Details
}
return ""
}
func (m *CallAcknowledged) GetSlotAllocationLatency() string {
if m != nil {
return m.SlotAllocationLatency
}
return ""
}
// Data sent C2S and S2C - as soon as the runner sees the first of these it // Data sent C2S and S2C - as soon as the runner sees the first of these it
// will start running. If empty content, there must be one of these with eof. // will start running. If empty content, there must be one of these with eof.
// The runner will send these for the body of the response, AFTER it has sent // The runner will send these for the body of the response, AFTER it has sent
@@ -104,7 +70,7 @@ type DataFrame struct {
func (m *DataFrame) Reset() { *m = DataFrame{} } func (m *DataFrame) Reset() { *m = DataFrame{} }
func (m *DataFrame) String() string { return proto.CompactTextString(m) } func (m *DataFrame) String() string { return proto.CompactTextString(m) }
func (*DataFrame) ProtoMessage() {} func (*DataFrame) ProtoMessage() {}
func (*DataFrame) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } func (*DataFrame) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
func (m *DataFrame) GetData() []byte { func (m *DataFrame) GetData() []byte {
if m != nil { if m != nil {
@@ -128,7 +94,7 @@ type HttpHeader struct {
func (m *HttpHeader) Reset() { *m = HttpHeader{} } func (m *HttpHeader) Reset() { *m = HttpHeader{} }
func (m *HttpHeader) String() string { return proto.CompactTextString(m) } func (m *HttpHeader) String() string { return proto.CompactTextString(m) }
func (*HttpHeader) ProtoMessage() {} func (*HttpHeader) ProtoMessage() {}
func (*HttpHeader) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } func (*HttpHeader) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
func (m *HttpHeader) GetKey() string { func (m *HttpHeader) GetKey() string {
if m != nil { if m != nil {
@@ -152,7 +118,7 @@ type HttpRespMeta struct {
func (m *HttpRespMeta) Reset() { *m = HttpRespMeta{} } func (m *HttpRespMeta) Reset() { *m = HttpRespMeta{} }
func (m *HttpRespMeta) String() string { return proto.CompactTextString(m) } func (m *HttpRespMeta) String() string { return proto.CompactTextString(m) }
func (*HttpRespMeta) ProtoMessage() {} func (*HttpRespMeta) ProtoMessage() {}
func (*HttpRespMeta) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } func (*HttpRespMeta) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
func (m *HttpRespMeta) GetStatusCode() int32 { func (m *HttpRespMeta) GetStatusCode() int32 {
if m != nil { if m != nil {
@@ -179,11 +145,9 @@ type CallResultStart struct {
func (m *CallResultStart) Reset() { *m = CallResultStart{} } func (m *CallResultStart) Reset() { *m = CallResultStart{} }
func (m *CallResultStart) String() string { return proto.CompactTextString(m) } func (m *CallResultStart) String() string { return proto.CompactTextString(m) }
func (*CallResultStart) ProtoMessage() {} func (*CallResultStart) ProtoMessage() {}
func (*CallResultStart) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } func (*CallResultStart) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
type isCallResultStart_Meta interface { type isCallResultStart_Meta interface{ isCallResultStart_Meta() }
isCallResultStart_Meta()
}
type CallResultStart_Http struct { type CallResultStart_Http struct {
Http *HttpRespMeta `protobuf:"bytes,100,opt,name=http,oneof"` Http *HttpRespMeta `protobuf:"bytes,100,opt,name=http,oneof"`
@@ -262,14 +226,16 @@ func _CallResultStart_OneofSizer(msg proto.Message) (n int) {
// Call has really finished, it might have completed or crashed // Call has really finished, it might have completed or crashed
type CallFinished struct { type CallFinished struct {
Success bool `protobuf:"varint,1,opt,name=success" json:"success,omitempty"` Success bool `protobuf:"varint,1,opt,name=success" json:"success,omitempty"`
Details string `protobuf:"bytes,2,opt,name=details" json:"details,omitempty"` Details string `protobuf:"bytes,2,opt,name=details" json:"details,omitempty"`
ErrorCode int32 `protobuf:"varint,3,opt,name=errorCode" json:"errorCode,omitempty"`
ErrorStr string `protobuf:"bytes,4,opt,name=errorStr" json:"errorStr,omitempty"`
} }
func (m *CallFinished) Reset() { *m = CallFinished{} } func (m *CallFinished) Reset() { *m = CallFinished{} }
func (m *CallFinished) String() string { return proto.CompactTextString(m) } func (m *CallFinished) String() string { return proto.CompactTextString(m) }
func (*CallFinished) ProtoMessage() {} func (*CallFinished) ProtoMessage() {}
func (*CallFinished) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } func (*CallFinished) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }
func (m *CallFinished) GetSuccess() bool { func (m *CallFinished) GetSuccess() bool {
if m != nil { if m != nil {
@@ -285,6 +251,20 @@ func (m *CallFinished) GetDetails() string {
return "" return ""
} }
func (m *CallFinished) GetErrorCode() int32 {
if m != nil {
return m.ErrorCode
}
return 0
}
func (m *CallFinished) GetErrorStr() string {
if m != nil {
return m.ErrorStr
}
return ""
}
type ClientMsg struct { type ClientMsg struct {
// Types that are valid to be assigned to Body: // Types that are valid to be assigned to Body:
// *ClientMsg_Try // *ClientMsg_Try
@@ -295,11 +275,9 @@ type ClientMsg struct {
func (m *ClientMsg) Reset() { *m = ClientMsg{} } func (m *ClientMsg) Reset() { *m = ClientMsg{} }
func (m *ClientMsg) String() string { return proto.CompactTextString(m) } func (m *ClientMsg) String() string { return proto.CompactTextString(m) }
func (*ClientMsg) ProtoMessage() {} func (*ClientMsg) ProtoMessage() {}
func (*ClientMsg) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } func (*ClientMsg) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }
type isClientMsg_Body interface { type isClientMsg_Body interface{ isClientMsg_Body() }
isClientMsg_Body()
}
type ClientMsg_Try struct { type ClientMsg_Try struct {
Try *TryCall `protobuf:"bytes,1,opt,name=try,oneof"` Try *TryCall `protobuf:"bytes,1,opt,name=try,oneof"`
@@ -408,7 +386,6 @@ func _ClientMsg_OneofSizer(msg proto.Message) (n int) {
type RunnerMsg struct { type RunnerMsg struct {
// Types that are valid to be assigned to Body: // Types that are valid to be assigned to Body:
// *RunnerMsg_Acknowledged
// *RunnerMsg_ResultStart // *RunnerMsg_ResultStart
// *RunnerMsg_Data // *RunnerMsg_Data
// *RunnerMsg_Finished // *RunnerMsg_Finished
@@ -418,29 +395,23 @@ type RunnerMsg struct {
func (m *RunnerMsg) Reset() { *m = RunnerMsg{} } func (m *RunnerMsg) Reset() { *m = RunnerMsg{} }
func (m *RunnerMsg) String() string { return proto.CompactTextString(m) } func (m *RunnerMsg) String() string { return proto.CompactTextString(m) }
func (*RunnerMsg) ProtoMessage() {} func (*RunnerMsg) ProtoMessage() {}
func (*RunnerMsg) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } func (*RunnerMsg) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} }
type isRunnerMsg_Body interface { type isRunnerMsg_Body interface{ isRunnerMsg_Body() }
isRunnerMsg_Body()
}
type RunnerMsg_Acknowledged struct {
Acknowledged *CallAcknowledged `protobuf:"bytes,1,opt,name=acknowledged,oneof"`
}
type RunnerMsg_ResultStart struct { type RunnerMsg_ResultStart struct {
ResultStart *CallResultStart `protobuf:"bytes,2,opt,name=result_start,json=resultStart,oneof"` ResultStart *CallResultStart `protobuf:"bytes,1,opt,name=result_start,json=resultStart,oneof"`
} }
type RunnerMsg_Data struct { type RunnerMsg_Data struct {
Data *DataFrame `protobuf:"bytes,3,opt,name=data,oneof"` Data *DataFrame `protobuf:"bytes,2,opt,name=data,oneof"`
} }
type RunnerMsg_Finished struct { type RunnerMsg_Finished struct {
Finished *CallFinished `protobuf:"bytes,4,opt,name=finished,oneof"` Finished *CallFinished `protobuf:"bytes,3,opt,name=finished,oneof"`
} }
func (*RunnerMsg_Acknowledged) isRunnerMsg_Body() {} func (*RunnerMsg_ResultStart) isRunnerMsg_Body() {}
func (*RunnerMsg_ResultStart) isRunnerMsg_Body() {} func (*RunnerMsg_Data) isRunnerMsg_Body() {}
func (*RunnerMsg_Data) isRunnerMsg_Body() {} func (*RunnerMsg_Finished) isRunnerMsg_Body() {}
func (*RunnerMsg_Finished) isRunnerMsg_Body() {}
func (m *RunnerMsg) GetBody() isRunnerMsg_Body { func (m *RunnerMsg) GetBody() isRunnerMsg_Body {
if m != nil { if m != nil {
@@ -449,13 +420,6 @@ func (m *RunnerMsg) GetBody() isRunnerMsg_Body {
return nil return nil
} }
func (m *RunnerMsg) GetAcknowledged() *CallAcknowledged {
if x, ok := m.GetBody().(*RunnerMsg_Acknowledged); ok {
return x.Acknowledged
}
return nil
}
func (m *RunnerMsg) GetResultStart() *CallResultStart { func (m *RunnerMsg) GetResultStart() *CallResultStart {
if x, ok := m.GetBody().(*RunnerMsg_ResultStart); ok { if x, ok := m.GetBody().(*RunnerMsg_ResultStart); ok {
return x.ResultStart return x.ResultStart
@@ -480,7 +444,6 @@ func (m *RunnerMsg) GetFinished() *CallFinished {
// XXX_OneofFuncs is for the internal use of the proto package. // XXX_OneofFuncs is for the internal use of the proto package.
func (*RunnerMsg) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { func (*RunnerMsg) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _RunnerMsg_OneofMarshaler, _RunnerMsg_OneofUnmarshaler, _RunnerMsg_OneofSizer, []interface{}{ return _RunnerMsg_OneofMarshaler, _RunnerMsg_OneofUnmarshaler, _RunnerMsg_OneofSizer, []interface{}{
(*RunnerMsg_Acknowledged)(nil),
(*RunnerMsg_ResultStart)(nil), (*RunnerMsg_ResultStart)(nil),
(*RunnerMsg_Data)(nil), (*RunnerMsg_Data)(nil),
(*RunnerMsg_Finished)(nil), (*RunnerMsg_Finished)(nil),
@@ -491,23 +454,18 @@ func _RunnerMsg_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*RunnerMsg) m := msg.(*RunnerMsg)
// body // body
switch x := m.Body.(type) { switch x := m.Body.(type) {
case *RunnerMsg_Acknowledged:
b.EncodeVarint(1<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Acknowledged); err != nil {
return err
}
case *RunnerMsg_ResultStart: case *RunnerMsg_ResultStart:
b.EncodeVarint(2<<3 | proto.WireBytes) b.EncodeVarint(1<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.ResultStart); err != nil { if err := b.EncodeMessage(x.ResultStart); err != nil {
return err return err
} }
case *RunnerMsg_Data: case *RunnerMsg_Data:
b.EncodeVarint(3<<3 | proto.WireBytes) b.EncodeVarint(2<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Data); err != nil { if err := b.EncodeMessage(x.Data); err != nil {
return err return err
} }
case *RunnerMsg_Finished: case *RunnerMsg_Finished:
b.EncodeVarint(4<<3 | proto.WireBytes) b.EncodeVarint(3<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Finished); err != nil { if err := b.EncodeMessage(x.Finished); err != nil {
return err return err
} }
@@ -521,15 +479,7 @@ func _RunnerMsg_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
func _RunnerMsg_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { func _RunnerMsg_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*RunnerMsg) m := msg.(*RunnerMsg)
switch tag { switch tag {
case 1: // body.acknowledged case 1: // body.result_start
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(CallAcknowledged)
err := b.DecodeMessage(msg)
m.Body = &RunnerMsg_Acknowledged{msg}
return true, err
case 2: // body.result_start
if wire != proto.WireBytes { if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType return true, proto.ErrInternalBadWireType
} }
@@ -537,7 +487,7 @@ func _RunnerMsg_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buff
err := b.DecodeMessage(msg) err := b.DecodeMessage(msg)
m.Body = &RunnerMsg_ResultStart{msg} m.Body = &RunnerMsg_ResultStart{msg}
return true, err return true, err
case 3: // body.data case 2: // body.data
if wire != proto.WireBytes { if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType return true, proto.ErrInternalBadWireType
} }
@@ -545,7 +495,7 @@ func _RunnerMsg_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buff
err := b.DecodeMessage(msg) err := b.DecodeMessage(msg)
m.Body = &RunnerMsg_Data{msg} m.Body = &RunnerMsg_Data{msg}
return true, err return true, err
case 4: // body.finished case 3: // body.finished
if wire != proto.WireBytes { if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType return true, proto.ErrInternalBadWireType
} }
@@ -562,24 +512,19 @@ func _RunnerMsg_OneofSizer(msg proto.Message) (n int) {
m := msg.(*RunnerMsg) m := msg.(*RunnerMsg)
// body // body
switch x := m.Body.(type) { switch x := m.Body.(type) {
case *RunnerMsg_Acknowledged:
s := proto.Size(x.Acknowledged)
n += proto.SizeVarint(1<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case *RunnerMsg_ResultStart: case *RunnerMsg_ResultStart:
s := proto.Size(x.ResultStart) s := proto.Size(x.ResultStart)
n += proto.SizeVarint(2<<3 | proto.WireBytes) n += proto.SizeVarint(1<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s)) n += proto.SizeVarint(uint64(s))
n += s n += s
case *RunnerMsg_Data: case *RunnerMsg_Data:
s := proto.Size(x.Data) s := proto.Size(x.Data)
n += proto.SizeVarint(3<<3 | proto.WireBytes) n += proto.SizeVarint(2<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s)) n += proto.SizeVarint(uint64(s))
n += s n += s
case *RunnerMsg_Finished: case *RunnerMsg_Finished:
s := proto.Size(x.Finished) s := proto.Size(x.Finished)
n += proto.SizeVarint(4<<3 | proto.WireBytes) n += proto.SizeVarint(3<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s)) n += proto.SizeVarint(uint64(s))
n += s n += s
case nil: case nil:
@@ -596,7 +541,7 @@ type RunnerStatus struct {
func (m *RunnerStatus) Reset() { *m = RunnerStatus{} } func (m *RunnerStatus) Reset() { *m = RunnerStatus{} }
func (m *RunnerStatus) String() string { return proto.CompactTextString(m) } func (m *RunnerStatus) String() string { return proto.CompactTextString(m) }
func (*RunnerStatus) ProtoMessage() {} func (*RunnerStatus) ProtoMessage() {}
func (*RunnerStatus) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } func (*RunnerStatus) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} }
func (m *RunnerStatus) GetActive() int32 { func (m *RunnerStatus) GetActive() int32 {
if m != nil { if m != nil {
@@ -607,7 +552,6 @@ func (m *RunnerStatus) GetActive() int32 {
func init() { func init() {
proto.RegisterType((*TryCall)(nil), "TryCall") proto.RegisterType((*TryCall)(nil), "TryCall")
proto.RegisterType((*CallAcknowledged)(nil), "CallAcknowledged")
proto.RegisterType((*DataFrame)(nil), "DataFrame") proto.RegisterType((*DataFrame)(nil), "DataFrame")
proto.RegisterType((*HttpHeader)(nil), "HttpHeader") proto.RegisterType((*HttpHeader)(nil), "HttpHeader")
proto.RegisterType((*HttpRespMeta)(nil), "HttpRespMeta") proto.RegisterType((*HttpRespMeta)(nil), "HttpRespMeta")
@@ -761,41 +705,37 @@ var _RunnerProtocol_serviceDesc = grpc.ServiceDesc{
func init() { proto.RegisterFile("runner.proto", fileDescriptor0) } func init() { proto.RegisterFile("runner.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{ var fileDescriptor0 = []byte{
// 566 bytes of a gzipped FileDescriptorProto // 511 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x93, 0x59, 0x6b, 0xdb, 0x40, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0x5d, 0x8b, 0xd3, 0x40,
0x10, 0xc7, 0xad, 0xd8, 0x71, 0xec, 0xb1, 0x92, 0xba, 0x4b, 0x0f, 0x93, 0x06, 0x1a, 0xd4, 0x03, 0x14, 0x6d, 0xb6, 0x9f, 0xb9, 0xc9, 0xae, 0x65, 0x10, 0x09, 0x75, 0xc1, 0x12, 0x3f, 0x08, 0x08,
0x43, 0x61, 0xd3, 0x3a, 0x3d, 0xde, 0x0a, 0x49, 0x9a, 0x20, 0x4a, 0x03, 0x65, 0x53, 0xfa, 0x6a, 0x53, 0xed, 0xea, 0xab, 0x0f, 0xd6, 0x5d, 0x82, 0xb0, 0x20, 0x53, 0xf1, 0xb5, 0x4c, 0x93, 0xdb,
0x36, 0xd2, 0x44, 0x56, 0xb3, 0xd2, 0x1a, 0xed, 0x28, 0xc5, 0xaf, 0xfd, 0x88, 0xfd, 0x44, 0x65, 0xb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b, 0x44, 0x53, 0xef, 0xad,
0xc7, 0x0e, 0xa0, 0xdf, 0x64, 0xe6, 0xd5, 0xc1, 0xf2, 0xe6, 0x60, 0xf9, 0xa9, 0x3d, 0xd8, 0xdd,
0x6d, 0xbe, 0xde, 0xc0, 0x65, 0xdf, 0xc9, 0x87, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x05, 0xe4,
0x7b, 0x85, 0xed, 0x03, 0x00, 0x00,
} }

View File

@@ -7,13 +7,6 @@ message TryCall {
string models_call_json = 1; string models_call_json = 1;
} }
// Call has been accepted and a slot allocated, or it's been rejected
message CallAcknowledged {
bool committed = 1;
string details = 2;
string slot_allocation_latency = 3;
}
// Data sent C2S and S2C - as soon as the runner sees the first of these it // Data sent C2S and S2C - as soon as the runner sees the first of these it
// will start running. If empty content, there must be one of these with eof. // will start running. If empty content, there must be one of these with eof.
// The runner will send these for the body of the response, AFTER it has sent // The runner will send these for the body of the response, AFTER it has sent
@@ -45,9 +38,10 @@ message CallResultStart {
message CallFinished { message CallFinished {
bool success = 1; bool success = 1;
string details = 2; string details = 2;
int32 errorCode = 3;
string errorStr = 4;
} }
message ClientMsg { message ClientMsg {
oneof body { oneof body {
TryCall try = 1; TryCall try = 1;
@@ -57,10 +51,9 @@ message ClientMsg {
message RunnerMsg { message RunnerMsg {
oneof body { oneof body {
CallAcknowledged acknowledged = 1; CallResultStart result_start = 1;
CallResultStart result_start = 2; DataFrame data = 2;
DataFrame data = 3; CallFinished finished = 3;
CallFinished finished = 4;
} }
} }

View File

@@ -199,19 +199,19 @@ func (ch *callHandle) enqueueMsgStrict(msg *runner.RunnerMsg) error {
return err return err
} }
func convertError(err error) string {
code := models.GetAPIErrorCode(err)
return fmt.Sprintf("%d:%s", code, err.Error())
}
// enqueueCallResponse enqueues a Submit() response to the LB // enqueueCallResponse enqueues a Submit() response to the LB
// and initiates a graceful shutdown of the session. // and initiates a graceful shutdown of the session.
func (ch *callHandle) enqueueCallResponse(err error) { func (ch *callHandle) enqueueCallResponse(err error) {
var details string var details string
var errCode int
var errStr string
if err != nil { if err != nil {
details = convertError(err) errCode = models.GetAPIErrorCode(err)
} else if ch.c != nil { errStr = err.Error()
}
if ch.c != nil {
details = ch.c.Model().ID details = ch.c.Model().ID
} }
@@ -219,18 +219,20 @@ func (ch *callHandle) enqueueCallResponse(err error) {
errTmp := ch.enqueueMsgStrict(&runner.RunnerMsg{ errTmp := ch.enqueueMsgStrict(&runner.RunnerMsg{
Body: &runner.RunnerMsg_Finished{Finished: &runner.CallFinished{ Body: &runner.RunnerMsg_Finished{Finished: &runner.CallFinished{
Success: err == nil, Success: err == nil,
Details: details, Details: details,
ErrorCode: int32(errCode),
ErrorStr: errStr,
}}}) }}})
if errTmp != nil { if errTmp != nil {
logrus.WithError(errTmp).Infof("enqueueCallResponse Send Error details=%v", details) logrus.WithError(errTmp).Infof("enqueueCallResponse Send Error details=%v err=%v:%v", details, errCode, errStr)
return return
} }
errTmp = ch.finalize() errTmp = ch.finalize()
if errTmp != nil { if errTmp != nil {
logrus.WithError(errTmp).Infof("enqueueCallResponse Finalize Error details=%v", details) logrus.WithError(errTmp).Infof("enqueueCallResponse Finalize Error details=%v err=%v:%v", details, errCode, errStr)
} }
} }

View File

@@ -5,8 +5,6 @@ import (
"encoding/json" "encoding/json"
"errors" "errors"
"io" "io"
"strconv"
"strings"
"time" "time"
"google.golang.org/grpc" "google.golang.org/grpc"
@@ -188,19 +186,16 @@ func sendToRunner(protocolClient pb.RunnerProtocol_EngageClient, call pool.Runne
} }
} }
func parseError(details string) error { func parseError(msg *pb.CallFinished) error {
tokens := strings.SplitN(details, ":", 2) if msg.GetSuccess() {
if len(tokens) != 2 || tokens[0] == "" || tokens[1] == "" { return nil
return errors.New(details)
} }
code, err := strconv.ParseInt(tokens[0], 10, 64) eCode := msg.GetErrorCode()
if err != nil { eStr := msg.GetErrorStr()
return errors.New(details) if eStr == "" {
eStr = "Unknown Error From Pure Runner"
} }
if code != 0 { return models.NewAPIError(int(eCode), errors.New(eStr))
return models.NewAPIError(int(code), errors.New(tokens[1]))
}
return errors.New(tokens[1])
} }
func tryQueueError(err error, done chan error) { func tryQueueError(err error, done chan error) {
@@ -263,7 +258,7 @@ DataLoop:
case *pb.RunnerMsg_Finished: case *pb.RunnerMsg_Finished:
logrus.Infof("Call finished Success=%v %v", body.Finished.Success, body.Finished.Details) logrus.Infof("Call finished Success=%v %v", body.Finished.Success, body.Finished.Details)
if !body.Finished.Success { if !body.Finished.Success {
err := parseError(body.Finished.GetDetails()) err := parseError(body.Finished)
tryQueueError(err, done) tryQueueError(err, done)
} }
break DataLoop break DataLoop