You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
specifically between _cts?.Cancel() and _cts?.Dispose() calls, we should await for the _watcherLoop task to finish. Otherwise it might attempt to access the Token of already disposed _cts, which is generally undesirable.
Also possible exception would be unobserved, which in turn may be a problem for applications with strict policies on unobserved exceptions.
What do you think? Will you consider a PR like this:
protectedvirtualvoidDispose(booldisposing){if(!disposedValue){if(disposing){_cts.Cancel();try{_watcherLoop.GetAwaiter().GetResult();}catch{//consume possible exception}_cts.Dispose();}disposedValue=true;}}
The text was updated successfully, but these errors were encountered:
Hi!
I think that current implementation of
Watcher.Dispose()
is a bit lacking:csharp/src/KubernetesClient/Watcher.cs
Lines 217 to 229 in 541abb0
specifically between
_cts?.Cancel()
and_cts?.Dispose()
calls, we should await for the_watcherLoop
task to finish. Otherwise it might attempt to access the Token of already disposed _cts, which is generally undesirable.Also possible exception would be unobserved, which in turn may be a problem for applications with strict policies on unobserved exceptions.
What do you think? Will you consider a PR like this:
The text was updated successfully, but these errors were encountered: