Closed bernardnormier closed 1 year ago
It was a "user error". I forgot to call ShutdownAsync on my ClientConnection. As a result, ClientConnection's DisposeAsync was canceling outstanding connection shutdown.
Lesson: if you see
Client connection from '[::1]:51186' to '[::1]:10000' failed to shutdown
System.OperationCanceledException: The operation was canceled.
at System.Threading.CancellationToken.ThrowOperationCanceledException()
at System.Threading.CancellationToken.ThrowIfCancellationRequested()
at IceRpc.Internal.IceRpcProtocolConnection.<>c__DisplayClass39_0.<<ShutdownAsync>g__PerformShutdownAsync|0>d.MoveNext() in /_/src/IceRpc/Internal/IceRpcProtocolConnection.cs:line 724
Make sure you didn't forget to call ShutdownAsync on your ClientConnection or ConnectionCache.
When the idle timer aborts a transport connection (see #3665), the stack trace for the Shutdown failure (when log level = Debug) should show the issue, but does not do so reliably.
Good stack trace:
Bad stack trace (same code):
In the bad case, it seems the shutdown hangs and times out instead of reporting immediately the Slic connection failure.