-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
server: ensure first node status written within Server.Start() #37168
Conversation
The fix ensures that the status of the first node is written before the end of `Server.Start`. Currently this is deferred and sometimes the code doesn't execute by the time the tests start running. For the rest of the nodes, the status is written as part of the node bootstrap. Fixes cockroachdb#33559 and cockroachdb#36990. Release note: None
This looks good to me, but give me a bit to understand all the node status code and why exactly putting a Line 468 in c1e83c9
I'll come back. Btw, you've changed the "fixes" line in the PR message, but I think that doesn't matter. I think the one that matters is the commit message, which is still wrong (I'm not completely sure, though). There's also a typo, but I don't know if that matters. |
I did just a little bit of digging. What I see is that, if I were to add the following diff so that a
It doesn't work because the cockroach/pkg/server/status/recorder.go Line 420 in 8bfe40f
cockroach/pkg/server/server.go Line 1538 in 8bfe40f
So now I wonder, is the Line 614 in 8bfe40f
Cause it seems to me like it wouldn't, for the same reason - because the MetricsRegistry is not properly initialized by that point. Is that call just useless and should we delete it? I'd be interested to know the answer here.The MetricsRecorder logs this warning if GenerateNodeStatus() is called too early. It'd be fantastic if we could turn it into returning an error...cockroach/pkg/server/status/recorder.go Line 423 in 8bfe40f
Alternatively, I think it'd be nice if Line 614 in 8bfe40f
|
This clears things up a bit. I tried moving |
yeah, LGTM, merge at will |
bors r+ |
37168: server: ensure first node status written within Server.Start() r=darinpp a=darinpp The fix ensures that the status of the first node is written before the end of `Server.Start`. Currently this is deferred and sometimes the code doesn't execute by the time the tests start running. For the rest of the nodes, the status is written as part of the node bootstrap. Fixes #33559, FIxes #36990. Release note: None Co-authored-by: Darin <darinp@gmail.com>
Build succeeded |
The fix ensures that the status of the first node is written before
the end of
Server.Start
. Currently this is deferredand sometimes the code doesn't execute by the time the tests start
running. For the rest of the nodes, the status is written as part of
the node bootstrap.
Fixes #33559, FIxes #36990.
Release note: None