MWI: Wait for service health before sending first heartbeat#60087
Merged
MWI: Wait for service health before sending first heartbeat#60087
Conversation
boxofrad
commented
Oct 9, 2025
ed5530d to
d011f22
Compare
2a25403 to
48b0203
Compare
Contributor
Author
|
Update: Fixed in #60148 |
48b0203 to
ec9ad91
Compare
a9b7123 to
022c3ae
Compare
strideynet
reviewed
Oct 15, 2025
| var cancel context.CancelFunc | ||
| ctx, cancel = context.WithTimeout( | ||
| context.WithoutCancel(ctx), | ||
| 5*time.Second, |
Contributor
There was a problem hiding this comment.
Nit: Extract this to a constant. Also - I can't recall off the top of my head - but do we wait for everything else to finish up before closing the bot identity client? I could see that ending up racing with this.
Contributor
Author
There was a problem hiding this comment.
Yeah, the identity service's Close method gets called in a defer, after all of the services have shut down.
strideynet
reviewed
Oct 15, 2025
strideynet
reviewed
Oct 15, 2025
strideynet
approved these changes
Oct 15, 2025
022c3ae to
5878e1e
Compare
ec9ad91 to
2afeaa2
Compare
nicholasmarais1158
approved these changes
Oct 20, 2025
2afeaa2 to
f763e57
Compare
5878e1e to
16e56e8
Compare
Uses the new `AllServicesReported` method to wait for all services to report their initial status before sending the "startup" heartbeat, with a timeout of 30 seconds. In one-shot mode, if the outer context is canceled (typically caused by another service returning an error) we'll hang on for up to 5 seconds to try to send the heartbeat before shutting down.
16e56e8 to
d9aef19
Compare
boxofrad
added a commit
that referenced
this pull request
Oct 22, 2025
Backport #60087 to branch/v18
boxofrad
added a commit
that referenced
this pull request
Oct 22, 2025
Backport #60087 to branch/v17
boxofrad
added a commit
that referenced
this pull request
Oct 29, 2025
Backport #60087 to branch/v18
boxofrad
added a commit
that referenced
this pull request
Oct 29, 2025
Backport #60087 to branch/v17
github-merge-queue bot
pushed a commit
that referenced
this pull request
Oct 29, 2025
* [v17] MWI: Automatically report service statuses in oneshot mode Backport #60148 to branch/v17 * [v17] MWI: Add `AllServicesReported` method to `readyz.Register` Backport #60059 to branch/v17 * [v17] MWI: Wait for service health before sending first heartbeat Backport #60087 to branch/v17 * [v17] MWI: Add service health to bot heartbeats Backport #60093 to branch/v17 * [v17] MWI: Simpler auto-generated `tbot` service names Backport #60052 to branch/v17 * Fix `testing/synctest` on CI * Fix linting of synctest files on CI * [v17] MWI: Fix flaky test in SPIFFE Workload APIs Backport #60668 to branch/v17
github-merge-queue bot
pushed a commit
that referenced
this pull request
Oct 29, 2025
* [v18] MWI: Automatically report service statuses in oneshot mode Backport #60148 to branch/v18 * [v18] MWI: Add `AllServicesReported` method to `readyz.Register` Backport #60059 to branch/v18 * [v18] MWI: Wait for service health before sending first heartbeat Backport #60087 to branch/v18 * [v18] MWI: Add service health to bot heartbeats Backport #60093 to branch/v18 * [v18] MWI: Simpler auto-generated `tbot` service names Backport #60052 to branch/v18 * Fix linting of synctest files on CI * [v18] MWI: Fix flaky test in SPIFFE Workload APIs Backport #60668 to branch/v18
mmcallister
pushed a commit
that referenced
this pull request
Nov 6, 2025
* MWI: Wait for service health before sending first heartbeat Uses the new `AllServicesReported` method to wait for all services to report their initial status before sending the "startup" heartbeat, with a timeout of 30 seconds. In one-shot mode, if the outer context is canceled (typically caused by another service returning an error) we'll hang on for up to 5 seconds to try to send the heartbeat before shutting down. * Swap clockwork with testing/synctest * Prevent identity service from reporting its status too early * Use test context * Extract durations into constants
mmcallister
pushed a commit
that referenced
this pull request
Nov 19, 2025
* MWI: Wait for service health before sending first heartbeat Uses the new `AllServicesReported` method to wait for all services to report their initial status before sending the "startup" heartbeat, with a timeout of 30 seconds. In one-shot mode, if the outer context is canceled (typically caused by another service returning an error) we'll hang on for up to 5 seconds to try to send the heartbeat before shutting down. * Swap clockwork with testing/synctest * Prevent identity service from reporting its status too early * Use test context * Extract durations into constants
mmcallister
pushed a commit
that referenced
this pull request
Nov 20, 2025
* MWI: Wait for service health before sending first heartbeat Uses the new `AllServicesReported` method to wait for all services to report their initial status before sending the "startup" heartbeat, with a timeout of 30 seconds. In one-shot mode, if the outer context is canceled (typically caused by another service returning an error) we'll hang on for up to 5 seconds to try to send the heartbeat before shutting down. * Swap clockwork with testing/synctest * Prevent identity service from reporting its status too early * Use test context * Extract durations into constants
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uses the new
AllServicesReportedmethod to wait for all services to report their initial status before sending the "startup" heartbeat, with a timeout of 30 seconds.In one-shot mode, if the outer context is canceled (typically caused by another service returning an error) we'll hang on for up to 5 seconds to try to send the heartbeat before shutting down.