fix(prefetch): allow for any prefetch to fail all of them - #82
Merged
Merged
Conversation
Currently, if any of the prefetch fails, it doesn't fails the whole thread pool. This means that the execution will hang until something kills it. This happened a few times when one of the prefetch fails and the CI just kept waiting. This change keeps running prefetch in parallel but allows a failure to cancel execution and raise the error.
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation safely propagates failures, terminates remaining workers, and includes focused regression coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Ensures parallel prefetch failures propagate immediately instead of hanging.
Changes:
- Tracks worker outcomes through a thread-safe queue.
- Terminates the thread pool after completion or failure.
- Adds regression coverage for blocked workers.
| File | Description |
|---|---|
lib/entitlements.rb |
Implements fail-fast prefetch execution and cleanup. |
spec/unit/entitlements_spec.rb |
Tests immediate worker-failure propagation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
to merge after #83
hosom
previously approved these changes
Sep 22, 2026
northrup
approved these changes
Sep 22, 2026
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.
Currently, if any of the prefetch fails, it doesn't fails the whole thread pool. This means that the execution will hang until something kills it. This happened a few times when one of the prefetch fails and the CI just kept waiting.
This change keeps running prefetch in parallel but allows a failure to cancel execution and raise the error.