Description
In Proto.Actor .NET we use the Kubernetes Client to Watch the Kubernetes API for active pods in a given namespace.
This works perfectly for the most clients, but in some cases, the Watch stops randomly after X time, usually days.
We have tried to bandaid this issue by recreating the client whenever there are any issues watching, but the issue is still manifesting.
https://github.com/asynkron/protoactor-dotnet/blob/dev/src/Proto.Cluster.Kubernetes/KubernetesClusterMonitor.cs#L90-L98
More to the point, the exception we get is this.
And even if we recreate a new Kubernetes Client, we still get the same issue.
Is it likely a network issue? e.g. connectivity problems?
Is it the Kubernetes API server that fails to respond?
Why is the problem persistent even if we recreate the Kubernetes Client?
I get that this might not be an issue in the Client lib itself, but that is what is throwing the exception.
Any ideas what could cause this?
exceptionMessage | The request was aborted. Unable to read data from the transport connection: Connection reset by peer. Connection reset by peer |
---|---|
exceptionMethod | Void ThrowRequestAborted(System.Exception) |
exceptionStackTrace | at System.Net.Http.Http2Connection.ThrowRequestAborted(Exception innerException) at System.Net.Http.Http2Connection.Http2Stream.CheckResponseBodyState() at System.Net.Http.Http2Connection.Http2Stream.TryReadFromBuffer(Span1 buffer, Boolean partOfSyncRead) at System.Net.Http.Http2Connection.Http2Stream.ReadDataAsync(Memory 1 buffer, HttpResponseMessage responseMessage, CancellationToken cancellationToken) at k8s.LineSeparatedHttpContent.CancelableStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) at System.IO.StreamReader.ReadBufferAsync(CancellationToken cancellationToken) at System.IO.StreamReader.ReadLineAsyncInternal() at k8s.Watcher1.<>c.<CreateWatchEventEnumerator>b__21_1[TR](Task 1 t) at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke() at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at k8s.Watcher 1.CreateWatchEventEnumerator(Func1 streamReaderCreator, Action 1 onError, CancellationToken cancellationToken)+MoveNext() at k8s.Watcher1.CreateWatchEventEnumerator(Func 1 |