chore(playbook): do not use single transaction to enable streaming - #3358
chore(playbook): do not use single transaction to enable streaming#3358yashmehrotra wants to merge 7 commits into
Conversation
|
Warning Review limit reached
Next review available in: 29 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
WalkthroughPlaybook consumers now claim actions in short transactions and execute them afterward. Pre-execution errors produce explicit failed or rescheduled states. A recurring job resets orphaned actions, with tests covering claims, failures, streaming, retries, and reaping. ChangesPlaybook action lifecycle
Sequence Diagram(s)sequenceDiagram
participant ActionConsumer
participant claimNextAction
participant runner.RunAction
participant failClaimedAction
ActionConsumer->>claimNextAction: Claim and start scheduled action
claimNextAction-->>ActionConsumer: Return running action and playbook run
ActionConsumer->>runner.RunAction: Execute outside transaction
runner.RunAction-->>ActionConsumer: Return result or error
ActionConsumer->>failClaimedAction: Mark still-running action failed
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
a750c6b to
60027fa
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@playbook/jobs.go`:
- Around line 156-186: Update ReapOrphanedActions and the local action-claim
flow to prevent reclaiming a locally executing action before its claim can
finish. Ensure the effective local claim timeout is always shorter than
playbook.action.orphan_timeout, or add a liveness/heartbeat check or in-flight
claim-timeout condition so the reaper excludes active claims; preserve reaping
behavior for genuinely orphaned actions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ef0a8230-c1dc-423a-8ca3-cc41f31d1c3c
📒 Files selected for processing (6)
jobs/jobs.gojobs/playbook.goplaybook/jobs.goplaybook/run_consumer.goplaybook/run_consumer_test.goplaybook/runner/runner.go
f585873 to
5ad07fe
Compare
Summary by CodeRabbit