-
Notifications
You must be signed in to change notification settings - Fork 304
Kubernetes Namespace pod watch can hang sometimes #1134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
what do you mean by |
I think that new pod events are not dispached from library in |
there is an |
Should you use error param? Seems that if error parameter is not used then exception is thrown. I dont use error param Should this work? I have something like this: while(true){
try{
var podlistResp = kubeClient.CoreV1.ListNamespacedPodWithHttpMessagesAsync(configurationSettings.DeploymentNamespace, watch: true);
await foreach (var (type, item) in podlistResp.WatchAsync<V1Pod, V1PodList>())
{
...
}
}
catch(){
}
} |
The above codewill not work properly. The reason for this is that you need to do an explicit List of the resources when the watch breaks. There is a race where if a resource is created after the watch ends and before the next watch begins you will miss that resource. The proper approach is: while (true) {
var list = // list all resources here
foreach (var item in list ) {
....
}
// watch resources here
} |
@brendandburns Seems that method And in this example of yours, would not you miss any new resources between list and watch calls if you think that Function name already says that - var podlistResp = kubeClient.CoreV1.ListNamespacedPodWithHttpMessagesAsync(configurationSettings.DeploymentNamespace, watch: true); |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
@gunpuz , did you figure out how to stop this from happening? I have a watch code which randomly stops receiving any events and is stuck till I restart my service. |
@Kruti-Joshi you can check if this is the cause |
@Kruti-Joshi, i think this issue went away when you "restart" the listener and listen again in a loop... |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close not-planned |
@k8s-triage-robot: Closing this issue, marking it as "Not Planned". In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
It seems that watch:
can hang from time to time. There seems to be no clear scenario how and when to reproduce it though :(
Server Kubernetes Version
v1.24.3
Dotnet Runtime Version
net6
To Reproduce
It can hang "sometimes". Its not clear why.
KubeConfig
Default configuration
Additional info
It could be related to this issue: #884
The text was updated successfully, but these errors were encountered: