kubernetes-client / java

Official Java client library for kubernetes
http://kubernetes.io/
Apache License 2.0
3.46k stars 1.84k forks source link

Watcher.eventReceived is still called after Watch.close #3445

Closed lonly-banlangen closed 1 month ago

lonly-banlangen commented 1 month ago

Describe the bug I use Resource.watch to bind watcher and watch. then I call Watch.close to stop watch, and edit the resource. finally Watcher.eventReceived is been called, the action is modified, maybe watch envent is continue, not stoped

# code is:
Resource<ConfigMap> resource = client.inNamespace(xxx)
                .configMaps()
                .withName(xxx);
watch = resource.watch(watcher);

Client Version java jar is:

io.fabric8
<artifactId>kubernetes-client</artifactId>
5.12.4

Kubernetes Version 1.22.1

Java Version Java 8

okhttp version 3.12.12

To Reproduce it's alwayse happend after Watch.close has been called

Expected behavior Watcher.eventReceived should not be called

KubeConfig If applicable, add a KubeConfig file with secrets redacted.

Server (please complete the following information):

Additional context Add any other context about the problem here.

lonly-banlangen commented 1 month ago

how the lisener is been stopped, whileWatchConnectionManager.close be called, i didn't find the code

brendandburns commented 1 month ago

This looks like the fabric8 client, not this client. I think you may need to file this issue on the fabric8 repository:

https://github.com/fabric8io/kubernetes-client