Add Closer on Runner interface#5527
Conversation
|
obviously i need to write a test |
Codecov ReportAttention: Patch coverage is
❌ Your patch status has failed because the patch coverage (39.02%) 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 #5527 +/- ##
==========================================
- Coverage 65.19% 65.18% -0.02%
==========================================
Files 213 213
Lines 34059 34080 +21
==========================================
+ Hits 22204 22214 +10
- Misses 10529 10538 +9
- Partials 1326 1328 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
|
ok ready |
| for _, r := range runners { | ||
| if err := r.runner.Close(); err != nil { | ||
| cfg.Logger.Error(err, "failed to close runner", "name", r.runner.Name()) | ||
| } | ||
| } |
There was a problem hiding this comment.
this is the main change on the main routine besides the host infra closure
|
/retest |
|
oh man the command exists here as well! |
| // This is ad-hoc sleep to wait for the Envoy process to start up to avoid canceling the context too early, | ||
| // which also results in the Envoy process being orphaned. | ||
| time.Sleep(1 * time.Second) |
There was a problem hiding this comment.
i think this seems an issue of func-e, not here and should be fixed there
|
lol we encountered a race in func-e |
|
marking as a draft for now |
go.mod
Outdated
| github.com/stretchr/testify v1.10.0 | ||
| github.com/telepresenceio/watchable v0.0.0-20220726211108-9bb86f92afa7 | ||
| github.com/tetratelabs/func-e v1.1.5-0.20240822223546-c85a098d5bf0 | ||
| github.com/tetratelabs/func-e v1.1.5-0.20250319205758-07e93e08850f |
There was a problem hiding this comment.
this is needed to have tetratelabs/func-e#458
|
great, passing with the latest func-e tetratelabs/func-e@ca8702e |
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
What type of PR is this?
chore: add Close method interface on Runner interface
What this PR does / why we need it:
Previously, the runner "shudown" was not existent, so the main goroutine doesn't wait for the cleanup that is not synchronous to the context closure or channel. That includes virtually all the operations after the context cancelation running in non main goroutines. One notable example is that when running with the host provider, Envoy processes are spawned and managed from non-main goroutines, so without the "synchronous" closure hook on Runner, it is impossible to ensure the exit of Envoy processes. Without this fix, for example, standalone mode will leave all the Envoy processes as orphans after the CLI exits with SIGINT or SIGTERM.
As a side effect, this also fixes a bug in the host provider which is that its CreateOrUpdateProxyInfra blocks forever until the Envoy process is running. That is not the expected semantics of infra.Manager interface.
Release Notes: No