未验证 提交 130fbaf4 编写于 作者: A Alessandro (Ale) Segala 提交者: GitHub

Fix panic in service invocation when connection fails (#6490)

Fixes error reported by user on Discord: https://discord.com/channels/778680217417809931/1055270900125138975/1109309802435321896Signed-off-by: NItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
上级 4a99f06b
......@@ -267,10 +267,6 @@ func (d *directMessaging) isHTTPEndpoint(appID string) bool {
return ok
}
func noopTeardown(destroy bool) {
// Nop
}
func (d *directMessaging) invokeHTTPEndpoint(ctx context.Context, appID, appNamespace, appAddress string, req *invokev1.InvokeMethodRequest) (*invokev1.InvokeMethodResponse, func(destroy bool), error) {
ctx = d.setContextSpan(ctx)
......@@ -284,13 +280,16 @@ func (d *directMessaging) invokeHTTPEndpoint(ctx context.Context, appID, appName
diag.DefaultMonitoring.ServiceInvocationResponseReceived(appID, req.Message().Method, imr.Status().Code, start)
}
return imr, noopTeardown, err
return imr, nopTeardown, err
}
func (d *directMessaging) invokeRemote(ctx context.Context, appID, appNamespace, appAddress string, req *invokev1.InvokeMethodRequest) (*invokev1.InvokeMethodResponse, func(destroy bool), error) {
conn, teardown, err := d.connectionCreatorFn(context.TODO(), appAddress, appID, appNamespace)
if err != nil {
return nil, nil, err
if teardown == nil {
teardown = nopTeardown
}
return nil, teardown, err
}
ctx = d.setContextSpan(ctx)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册