Skip to content

Wait for the runners to close#5560

Merged
shawnh2 merged 2 commits intoenvoyproxy:mainfrom
mathetake:waitforrunners
Mar 21, 2025
Merged

Wait for the runners to close#5560
shawnh2 merged 2 commits intoenvoyproxy:mainfrom
mathetake:waitforrunners

Conversation

@mathetake
Copy link
Copy Markdown
Member

@mathetake mathetake commented Mar 20, 2025

This is a follow up on #5527 which was not sufficient to ensure Envoy processes to stop before exiting the program.

Release Notes: No

Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 20, 2025

Codecov Report

Attention: Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.

Project coverage is 65.20%. Comparing base (1b0954c) to head (97ff38e).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
internal/cmd/server.go 0.00% 9 Missing ⚠️

❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (60.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5560      +/-   ##
==========================================
- Coverage   65.22%   65.20%   -0.02%     
==========================================
  Files         213      213              
  Lines       34106    34111       +5     
==========================================
- Hits        22246    22243       -3     
- Misses      10533    10541       +8     
  Partials     1327     1327              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mathetake mathetake marked this pull request as ready for review March 20, 2025 20:58
@mathetake mathetake requested a review from a team as a code owner March 20, 2025 20:58
@mathetake
Copy link
Copy Markdown
Member Author

/retest


// Wait exit signal
// Wait for the context to be done, which usually happens the process receives a SIGTERM or SIGINT.
<-ctx.Done()
Copy link
Copy Markdown
Member Author

@mathetake mathetake Mar 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note on why <-runnersDone is needed; Right after ctx is canceled, this main goroutine will call os.Exit(0) vs runners are not running on the main goroutine. so without blocking and waiting for it to return, this will highly likely leave some undesirable state orphaned that is supposed to be cleaned up by non-main goroutine where runners' Close() is executed.

arkodg
arkodg previously approved these changes Mar 20, 2025
Copy link
Copy Markdown
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks !

@arkodg arkodg requested review from a team March 20, 2025 21:35
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
@shawnh2 shawnh2 merged commit ce22df1 into envoyproxy:main Mar 21, 2025
24 of 25 checks passed
@zirain zirain mentioned this pull request Jan 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants