-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
democluster: improve logging/tracing #72642
Conversation
33fb324
to
c43c825
Compare
c43c825
to
8fdea3c
Compare
8fdea3c
to
1a5e571
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, let me know if you want to me to re-review the second commit in the set of three if you do a major enough refactor.
pkg/cli/democluster/demo_cluster.go
Outdated
@@ -228,10 +228,11 @@ func (c *transientCluster) Start( | |||
// Step 1: create the first node. | |||
{ | |||
phaseCtx := logtags.AddTag(ctx, "phase", 1) | |||
c.infoLog(phaseCtx, "creating the first node") | |||
ctx := phaseCtx // shadow the original ctx; folk prefer this name to "phaseCtx". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit (for all): folk prefer this name to "phaseCtx"
didn't make sense to me as to what class of error this was preventing until i read the commit message. maybe shadow the original ctx to prevent accidentally using the original ctx instead of the phaseCtx which can be a easy reach as a mistake
or something?
alternatively, make all these steps individual functions passing in the phase context and having the function take in ctx
and avoid the shadowing entirely. hopefully the refactor for that isn't too nasty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, the individual functions seems to be the better choice. I'll work on that next.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(the linter doesn't like the shadowing anyway)
1a5e571
to
eb766b0
Compare
RFAL |
Release note: None
We've seen folk make mistakes because they instinctly reach to the name "ctx" in their text editor. Prevent those mistakes by ensuring the phase context is also called "ctx". Release note: None
Release note: None
eb766b0
to
d3ce8d3
Compare
TFYR! bors r=otan |
Build failed: |
bors r=otan |
Build succeeded: |
All commits but the last 3 from #72644
(Reviewers: only review last 3 commits)
Informs #58938