-
-
Notifications
You must be signed in to change notification settings - Fork 729
Run Engine 2: reschedule heartbeats and added a test to check it works #1765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
WalkthroughThe changes update the heartbeat management in the RunEngine. The intermediary method Changes
Sequence Diagram(s)sequenceDiagram
participant Test as Test Suite
participant RE as RunEngine
participant W as Worker
Test->>RE: Start run with heartbeat configuration
RE->>W: Reschedule heartbeat (using getHeartbeatIntervalMs)
alt Heartbeat active
W-->>RE: Heartbeat callback received
RE->>W: Enqueue next heartbeat job
else Heartbeat stops
Note over RE: Run eventually times out
end
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
⏰ Context from checks skipped due to timeout of 90000ms (6)
🔇 Additional comments (3)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
This pull request includes changes to improve the heartbeat mechanism in the
RunEngine
class and adds a new test to ensure the functionality of the heartbeat system. The most important changes include refactoring the heartbeat scheduling logic and adding a comprehensive test case.Improvements to heartbeat mechanism:
internal-packages/run-engine/src/engine/index.ts
: Refactored the heartbeat scheduling logic by removing the#setHeartbeatDeadline
method and directly scheduling heartbeats usingthis.worker.enqueue
andthis.worker.reschedule
methods. [1] [2] [3]Addition of new test:
internal-packages/run-engine/src/engine/tests/heartbeats.test.ts
: Added a new test case "Heartbeat keeps run alive" to verify that the heartbeat mechanism correctly keeps the run alive and transitions to the queued state after the timeout period when heartbeats are no longer sent.Summary by CodeRabbit