Isolate health-report probes so a slow builder can't starve others - #1018
Merged
Conversation
collectHealthReport fired every builder probe via CompletableFuture.supplyAsync without an executor, so they shared the common ForkJoinPool while making a blocking HTTP call. completeOnTimeout completes the future but does not cancel the running task, so a slow builder held its pool thread for the whole socket lifetime. On a few-core host a slow node could starve a healthy node's probe, which was then mis-reported as Unreachable -- the flaky testRemoteNodesNotFullyOperational failure on CI. Run each probe on a dedicated pool sized to the number of builders, and bound the blocking execute() with a per-request RequestConfig timeout so a stuck builder releases its worker near the timeout. Add a regression test pairing a fast node with a slow one and asserting the fast node stays Operational.
Summary - Extender code coverage reportSummary
Coveragecom/defold/extender - 29.5%
com/defold/extender/builders - 0%
com/defold/extender/cache - 33.3%
com/defold/extender/cache/info - 100%
com/defold/extender/log - 14.2%
com/defold/extender/metrics - 38.8%
com/defold/extender/process - 52.7%
com/defold/extender/remote - 96%
com/defold/extender/services - 44.9%
com/defold/extender/services/cocoapods - 51.9%
com/defold/extender/services/data - 80.7%
com/defold/extender/tracing - 21.8%
com/defold/extender/utils - 0%
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 45402b0379
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Capping the pool at 32 reintroduced the starvation it was meant to fix: with more than 32 builders, probes past the cap wait in the executor queue while their completeOnTimeout timer -- started at submission, not at execution -- is already running, so a healthy builder could time out to false before its request ran. Size the pool to the exact builder count so no probe queues.
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.
collectHealthReport()fired every builder probe viaCompletableFuture.supplyAsyncwithout an executor, so they shared the commonForkJoinPoolwhile making a blocking HTTP call.completeOnTimeout()completes the future but does not cancel the running task, so a slow builder held its pool thread for the whole socket lifetime. On a few-core host a slow node could starve a healthy node's probe, which was then mis-reported as Unreachable.Run each probe on a dedicated pool sized to the number of builders, and bound the blocking
execute()with a per-requestRequestConfigtimeout so a stuck builder releases its worker near the timeout. Add a regression test pairing a fast node with a slow one and asserting the fast node stays Operational.