spring-cloud-kubernetes icon indicating copy to clipboard operation
spring-cloud-kubernetes copied to clipboard

Decrease log level of "ConfigMaps watch closed" statement

Open Jereminet opened this issue 3 years ago • 2 comments

Hi,

I'm currently using the spring-cloud-starter-kubernetes-fabric8-config dependency in to leverage automatic configMap reload when deploying my project in OpenShift. The issue is that my microservices are meant to stay up for a long period of time, therefore resulting in having the following statement logged really often (at random intervals):

io.fabric8.kubernetes.client.WatcherException: too old resource version: 7200362 (11665615) at io.fabric8.kubernetes.client.dsl.internal.AbstractWatchManager.onStatus(AbstractWatchManager.java:273) at io.fabric8.kubernetes.client.dsl.internal.AbstractWatchManager.onMessage(AbstractWatchManager.java:257) at io.fabric8.kubernetes.client.dsl.internal.WatcherWebSocketListener.onMessage(WatcherWebSocketListener.java:93) at okhttp3.internal.ws.RealWebSocket.onReadMessage(RealWebSocket.kt:333) at okhttp3.internal.ws.WebSocketReader.readMessageFrame(WebSocketReader.kt:245) at okhttp3.internal.ws.WebSocketReader.processNextFrame(WebSocketReader.kt:106) at okhttp3.internal.ws.RealWebSocket.loopReader(RealWebSocket.kt:293) at okhttp3.internal.ws.RealWebSocket$connect$1.onResponse(RealWebSocket.kt:195) at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source) Caused by: io.fabric8.kubernetes.client.KubernetesClientException: too old resource version: 7200362 (11665615) ... 12 common frames omitted

From what I can see in EventBasedConfigMapChangeDetector.java, you handle this closure by then re-creating a new watch, and this is confirmed by various logs I see in my microservices as well as the automatic reload still functioning correctly despite the previous warning.

Therefore, could it be possible to change the log level of the "ConfigMaps watch closed" statement to debug, as it is already the case for other similar statements in the same class, to avoid polluting the logs ?

Kind regards

Jereminet avatar Sep 21 '22 13:09 Jereminet

yeah, totally doable. we currently have it on warn, which comes before info, so it's always logged.

@ryanjbaxter should I move it to debug? This does not require any changes in main - since we do not use neither watchers nor fabric8 in main. thank you.

wind57 avatar Sep 21 '22 14:09 wind57

Sure I don't have any strong objection

ryanjbaxter avatar Sep 21 '22 14:09 ryanjbaxter

this can be closed btw... thank you for opening the defect @Jereminet

wind57 avatar Sep 24 '22 20:09 wind57