kubernetes-client/java

Watcher.eventReceived is still called after Watch.close

lonly-banlangen opened this issue · 2 comments

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
kubernetes-client
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):

  • OS: centos
  • Environment: docker container
  • Cloud: not clopud

Additional context
Add any other context about the problem here.

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

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