xds: Do not log an error on a done context#42990
Merged
joestringer merged 1 commit intocilium:mainfrom Dec 2, 2025
Merged
Conversation
Member
Author
|
/test |
reflect.Select chooses the select case randomly when multiple cases could be chosen. If a watch channel is chosen due to it getting closed, it is likely that the reason for the closure was context cancellation, rather than some other error condition. If this is the case debug log the cancellation via the done channel case, instead of logging a watch error. This fixes CI flakes due to error logs like here: level=debug source=/go/src/github.com/cilium/cilium/pkg/envoy/xds/watcher.go:169 msg="context canceled, terminating resource watch" module=agent.controlplane.envoy-proxy xdsAckedVersion=21 xdsClientNode=127.0.0.1 xdsTypeURL=type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.Secret level=error source=/go/src/github.com/cilium/cilium/pkg/envoy/xds/server.go:444 msg="xDS resource watch failed; terminating" module=agent.controlplane.envoy-proxy xdsStreamID=21 xdsClientNode=host~127.0.0.1~no-id~localdomain xdsTypeURL=type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.Secret Signed-off-by: Jarno Rajahalme <[email protected]>
6707696 to
2e44683
Compare
Member
Author
|
/test |
Member
|
Is this worth backporting to v1.18 for CI stability there? |
sayboras
approved these changes
Dec 2, 2025
Member
Author
Added |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
reflect.Select chooses the select case randomly when multiple cases could be chosen. If a watch channel is chosen due to it getting closed, it is likely that the reason for the closure was context cancellation, rather than some other error condition. If this is the case debug log the cancellation via the done channel case, instead of logging a watch error.
This fixes CI flakes due to unexpected error logs like here:
level=debug source=/go/src/github.com/cilium/cilium/pkg/envoy/xds/watcher.go:169 msg="context canceled, terminating resource watch" module=agent.controlplane.envoy-proxy xdsAckedVersion=21 xdsClientNode=127.0.0.1 xdsTypeURL=type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.Secret level=error source=/go/src/github.com/cilium/cilium/pkg/envoy/xds/server.go:444 msg="xDS resource watch failed; terminating" module=agent.controlplane.envoy-proxy xdsStreamID=21 xdsClientNode=host
127.0.0.1no-id~localdomain xdsTypeURL=type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.Secret