Skip to content
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

Spring Cloud Kubernetes - Use Informers instead of Watchers #1587

Open
a-maggioni opened this issue Feb 24, 2024 · 3 comments · May be fixed by #1658
Open

Spring Cloud Kubernetes - Use Informers instead of Watchers #1587

a-maggioni opened this issue Feb 24, 2024 · 3 comments · May be fixed by #1658

Comments

@a-maggioni
Copy link

a-maggioni commented Feb 24, 2024

Is your feature request related to a problem? Please describe.
On Spring Boot 3.2.2 with Spring Cloud 2023.0.0 the following warning appears in the logs when Kubernetes leader election is in use:
io.fabric8.kubernetes.client.WatcherException: too old resource version: 18679401 (18803484) at io.fabric8.kubernetes.client.dsl.internal.AbstractWatchManager.onStatus(AbstractWatchManager.java:273) ~[kubernetes-client-5.10.2.jar!/:na] at io.fabric8.kubernetes.client.dsl.internal.AbstractWatchManager.onMessage(AbstractWatchManager.java:257) ~[kubernetes-client-5.10.2.jar!/:na] at io.fabric8.kubernetes.client.dsl.internal.WatcherWebSocketListener.onMessage(WatcherWebSocketListener.java:93) ~[kubernetes-client-5.10.2.jar!/:na] at okhttp3.internal.ws.RealWebSocket.onReadMessage(RealWebSocket.kt:333) ~[okhttp-4.9.3.jar!/:na] at okhttp3.internal.ws.WebSocketReader.readMessageFrame(WebSocketReader.kt:245) ~[okhttp-4.9.3.jar!/:na] at okhttp3.internal.ws.WebSocketReader.processNextFrame(WebSocketReader.kt:106) ~[okhttp-4.9.3.jar!/:na] at okhttp3.internal.ws.RealWebSocket.loopReader(RealWebSocket.kt:293) ~[okhttp-4.9.3.jar!/:na] at okhttp3.internal.ws.RealWebSocket$connect$1.onResponse(RealWebSocket.kt:195) ~[okhttp-4.9.3.jar!/:na] at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519) ~[okhttp-4.9.3.jar!/:na] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[na:na] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[na:na] at java.base/java.lang.Thread.run(Thread.java:840) ~[na:na] Caused by: io.fabric8.kubernetes.client.KubernetesClientException: too old resource version: 18679401 (18803484) ... 12 common frames omitted

Describe the solution you'd like
According to this, Spring Cloud should migrate from using raw Watchers to Informers.

Additional context
See this for further details.

@wind57
Copy link
Contributor

wind57 commented Sep 25, 2024

when this one is ready : #1658 this issue is going to be closed, because in that implementation, we do not use watchers or informers at all

@viktorpergjoka
Copy link

If you need to use Informers with spring you can check out this:

https://github.com/viktorpergjoka/spring-k8swatcher

@wind57
Copy link
Contributor

wind57 commented Oct 19, 2024

this is very neat! I took a fast pass over it and I really liked it! I hope to have time to look more into it and see if I can "steal" some of your ideas. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants