Skip to content

Canceled client result can result in connection being closed #43054

Closed
@BrennanConroy

Description

@BrennanConroy

Using the new client results feature in SignalR, if you pass in a cancellation token to InvokeAsync and cancel it, the server-side will properly clean-up the call, but the client-side will still send a result it produces one which will result in the HubProtocol serializer throwing when trying to resolve the type to deserialize the response to (as the server-side doesn't know about the invocation anymore). When the HubProtocol throws the connection is closed because we have to assume the connections pipe is no longer usable (partial reads etc.).

public Type GetReturnType(string invocationId)
{
if (_hubLifetimeManager.TryGetReturnType(invocationId, out var type))
{
return type;
}
throw new InvalidOperationException($"Unknown invocation ID '{invocationId}'.");

Metadata

Metadata

Assignees

Labels

Priority:1Work that is critical for the release, but we could probably ship withoutapi-approvedAPI was approved in API review, it can be implementedarea-signalrIncludes: SignalR clients and serversbugThis issue describes a behavior which is not expected - a bug.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions