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

Remove duplicated <-s.ReadyNotify() #19057

Merged
merged 1 commit into from
Dec 13, 2024
Merged

Conversation

ahrtr
Copy link
Member

@ahrtr ahrtr commented Dec 13, 2024

Follow up to #19041

It was a mistake that I made when debugging the codecov/patch failure in #19041. Sorry. Also refer to #19046 (comment)

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahrtr, serathius

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@serathius
Copy link
Member

Should we add a test for shutdown during initialization?

Copy link

codecov bot commented Dec 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.84%. Comparing base (026bbec) to head (16ccfc9).
Report is 2 commits behind head on main.

Additional details and impacted files
Files with missing lines Coverage Δ
server/embed/serve.go 57.19% <ø> (-0.16%) ⬇️

... and 23 files with indirect coverage changes

@@            Coverage Diff             @@
##             main   #19057      +/-   ##
==========================================
+ Coverage   68.79%   68.84%   +0.04%     
==========================================
  Files         420      420              
  Lines       35627    35626       -1     
==========================================
+ Hits        24509    24525      +16     
+ Misses       9688     9680       -8     
+ Partials     1430     1421       -9     

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 026bbec...16ccfc9. Read the comment docs.

@ahrtr
Copy link
Member Author

ahrtr commented Dec 13, 2024

/retest

@ahrtr
Copy link
Member Author

ahrtr commented Dec 13, 2024

Should we add a test for shutdown during initialization?

It's good to have, but hard to test. The problem is that etcd doesn't wait for the following goroutine to complete or exit when it's stopping. So from product functionality perspective, we don't see any issue. This PR (and previous one) just avoids some unnecessary operations when the server is stopping.

etcd/server/embed/etcd.go

Lines 777 to 779 in 026bbec

go func(s *serveCtx) {
e.errHandler(s.serve(e.Server, &e.cfg.ClientTLSInfo, mux, e.errHandler, e.grpcGatewayDial(splitHTTP), splitHTTP, gopts...))
}(sctx)

Even the goroutine leakage detection can't detect it either, because a golang program execution does not wait for the invoked function to complete.

func RegisterLeakDetection(t TB) {
if err := CheckAfterTest(10 * time.Millisecond); err != nil {
t.Skip("Found leaked goroutined BEFORE test", err)
return
}
t.Cleanup(func() {
afterTest(t)
})
}

@ahrtr
Copy link
Member Author

ahrtr commented Dec 13, 2024

An related but different case: I recall that user applications might run into a deadlock in embeded use case if etcd is being stopped during bootstrap. Raised #19058

@ahrtr ahrtr merged commit 25dfc82 into etcd-io:main Dec 13, 2024
35 checks passed
@ahrtr ahrtr deleted the ready_notify_20241213 branch December 13, 2024 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants