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

Fix race condition (also a regression of the PR 19139) #19221

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ahrtr
Copy link
Member

@ahrtr ahrtr commented Jan 17, 2025

Fix #19172

Please review this PR commit by commit.

Two high level thoughts,

  • There are multiple levels of goroutines. The grandparent ( StartEtcd ) creates multiple child goroutines ( client listeners, peer listeners and metrics listeners). The client listeners creates some grandson goroutines (see the first commit). Each one should only manage their immediate children.
  • For sync.WaitGroup, we should always call wg.Add and wg.Wait in the same goroutine.

cc @serathius @fuweid @ivanvc @jmhbnz @joshuazh-x

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahrtr

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

Copy link

codecov bot commented Jan 17, 2025

Codecov Report

Attention: Patch coverage is 77.27273% with 5 lines in your changes missing coverage. Please review.

Project coverage is 68.80%. Comparing base (ecd7cfc) to head (1dcdfc1).

Files with missing lines Patch % Lines
server/embed/serve.go 81.25% 1 Missing and 2 partials ⚠️
server/embed/etcd.go 66.66% 2 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
server/embed/etcd.go 76.19% <66.66%> (+0.33%) ⬆️
server/embed/serve.go 59.38% <81.25%> (+1.58%) ⬆️

... and 21 files with indirect coverage changes

@@            Coverage Diff             @@
##             main   #19221      +/-   ##
==========================================
+ Coverage   68.76%   68.80%   +0.04%     
==========================================
  Files         420      420              
  Lines       35650    35665      +15     
==========================================
+ Hits        24513    24539      +26     
+ Misses       9714     9703      -11     
  Partials     1423     1423              

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 ecd7cfc...1dcdfc1. Read the comment docs.

@ahrtr
Copy link
Member Author

ahrtr commented Jan 17, 2025

@fuweid @ivanvc @jmhbnz @serathius

This PR fixed a regression caused by #19139. So let's get this merged and backport to 3.5 and probably 3.4. We need to get it included in 3.5.18

@ahrtr
Copy link
Member Author

ahrtr commented Jan 17, 2025

/retest

@ahrtr
Copy link
Member Author

ahrtr commented Jan 17, 2025

/test pull-etcd-integration-1-cpu-arm64

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.

Race condition when closing the embedded etcd
2 participants