Skip to content

Commit

Permalink
xds: suppress redundant updates only when we are SERVING (#5258)
Browse files Browse the repository at this point in the history
  • Loading branch information
easwars committed Mar 21, 2022
1 parent 4635bf2 commit 51ddcba
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion xds/internal/server/listener_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,12 @@ func (l *listenerWrapper) switchMode(fcs *xdsresource.FilterChainManager, newMod
defer l.mu.Unlock()

l.filterChains = fcs
if l.mode == newMode {
if l.mode == newMode && l.mode == connectivity.ServingModeServing {
// Redundant updates are suppressed only when we are SERVING and the new
// mode is also SERVING. In the other case (where we are NOT_SERVING and the
// new mode is also NOT_SERVING), the update is not suppressed as:
// 1. the error may have change
// 2. it provides a timestamp of the last backoff attempt
return
}
l.mode = newMode
Expand Down

0 comments on commit 51ddcba

Please sign in to comment.