icerpc / icerpc-csharp

A C# RPC framework built for QUIC, with bidirectional streaming, first-class async/await, and Protobuf support.
https://docs.icerpc.dev
Apache License 2.0
102 stars 13 forks source link

Revisit client error when server aborts connection due to MaxConnections (ice protocol) #4031

Open bernardnormier opened 2 weeks ago

bernardnormier commented 2 weeks ago

When an ice-protocol server rejects a new connection because MaxConnections is reached, it aborts the transport connection:

https://github.com/icerpc/icerpc-csharp/blob/c866c086c6e0b2064681351cf0c7c0a1b4f79d61/src/IceRpc/Server.cs#L908

This abort is in turn received by the client as an IceRpcError.ConnectionAborted (fine) or uncategorized error (IceRpcError.IceRpcError). See #2462.

This behavior is problematic because the ConnectionCache "move to the next server address" requires specific error codes, and IceRpcError.IceRpcError (= uncategorized error) is not among them. See #4027.