Skip to content

resolver: log resolver state updates at verbosity 2#9211

Open
lucacucchetti wants to merge 1 commit into
grpc:masterfrom
lucacucchetti:resolver-channelz-trace-verbosity
Open

resolver: log resolver state updates at verbosity 2#9211
lucacucchetti wants to merge 1 commit into
grpc:masterfrom
lucacucchetti:resolver-channelz-trace-verbosity

Conversation

@lucacucchetti

@lucacucchetti lucacucchetti commented Jun 29, 2026

Copy link
Copy Markdown

Fixes #9210

addChannelzTraceEvent logs the full resolver.State (via pretty.ToJSON) on every UpdateState/NewAddress. The #7437 guard !logger.V(0) && !channelz.IsOn() does not fire at the default verbosity (logger.V(0) is true), so with channelz off the whole state is marshalled on every update only to be discarded by the default ERROR-level logger. See #9210 for benchmarks and analysis.

V(2) is the verbosity used for detailed logs throughout the tree (this was the only V(0) gate). channelz, when enabled, still records the event.

Behavior change: at the default verbosity the "Resolver state updated" message no longer logs; it now requires -v 2.

RELEASE NOTES:

  • resolver: only log resolver state updates at verbosity 2 or higher, avoiding a full marshal of the resolver state on every update when channelz is off and verbose logging is disabled

Fixes grpc#9210

addChannelzTraceEvent logs the full resolver.State (via pretty.ToJSON) on
every UpdateState/NewAddress. The grpc#7437 guard `!logger.V(0) && !channelz.IsOn()`
does not fire at the default verbosity (logger.V(0) is true), so with channelz
off the whole state is marshaled on every update only to be discarded by the
default ERROR-level logger. See grpc#9210 for benchmarks and analysis.

V(2) is the verbosity used for detailed logs throughout the tree (this was the
only V(0) gate). channelz, when enabled, still records the event.

Behavior change: at the default verbosity the "Resolver state updated" message
no longer logs; it now requires -v 2.

RELEASE NOTES:
* resolver: only log resolver state updates at verbosity 2 or higher, avoiding a full marshal of the resolver state on every update when channelz is off and verbose logging is disabled
@linux-foundation-easycla

Copy link
Copy Markdown

CLA Not Signed

@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.23%. Comparing base (d74861e) to head (aed95cc).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9211      +/-   ##
==========================================
+ Coverage   83.21%   83.23%   +0.02%     
==========================================
  Files         420      420              
  Lines       34008    34008              
==========================================
+ Hits        28299    28307       +8     
+ Misses       4275     4269       -6     
+ Partials     1434     1432       -2     
Files with missing lines Coverage Δ
resolver_wrapper.go 93.45% <100.00%> (+1.86%) ⬆️

... and 18 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mbissa

mbissa commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

can you please sign the CLA @lucacucchetti, it will allow us to review the PR

@lucacucchetti

Copy link
Copy Markdown
Author

Hi @mbissa, working on it apologies, looks like the legal reviewer from our side is out until next week.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

resolver: addChannelzTraceEvent marshals full resolver.State on every update even when discarded

2 participants