Skip to content
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

The server should not be set to a healthy state when it is not started #51596

Closed
shenqidebaozi opened this issue Mar 7, 2024 · 0 comments · Fixed by #51595
Closed

The server should not be set to a healthy state when it is not started #51596

shenqidebaozi opened this issue Mar 7, 2024 · 0 comments · Fixed by #51595

Comments

@shenqidebaozi
Copy link
Contributor

When initializing the struct of the server, health is set to true by default

health: uatomic.NewBool(true),

But there is a lot of preparation work after starting the server, and at this time, the service cannot be set to healthy, otherwise it may cause errors. It can be set to healthy after initialization is completed.

tidb/pkg/server/server.go

Lines 457 to 467 in 54cca35

go s.startNetworkListener(s.listener, false, errChan)
go s.startNetworkListener(s.socket, true, errChan)
if RunInGoTest && !isClosed(RunInGoTestChan) {
close(RunInGoTestChan)
}
err = <-errChan
if err != nil {
return err
}
return <-errChan
}

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

Successfully merging a pull request may close this issue.

3 participants