Repository navigation
Simplify yield logic - #296
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📝 WalkthroughWalkthroughThe runtime scheduler was refactored to use AnyTask instead of WaitNode across core paths — getNextTask now returns ?*AnyTask, yield/run/cleanup and queue handling updated accordingly. RunMode lost the until_idle variant. A mutex contention stress test was added to src/sync/Mutex.zig. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/runtime.zig`:
- Around line 413-420: The assert after calling executor.run(.until_ready)
assumes the main task became ready; instead check whether the loop stopped
first: after executor.run(.until_ready) returns, inspect executor.loop.stopped()
(or self.loop.stopped()) and if true call `@panic` with a clear message like
"event loop stopped while main task was yielding"; otherwise keep the existing
std.debug.assert(task.state.load(.acquire) == .ready). Update the block handling
the main task (referencing executor.run(.until_ready), executor.main_task, and
task.state) to include this guard so the diagnostic is explicit when the loop
was externally stopped.
🧹 Nitpick comments (1)
src/runtime.zig (1)
388-411: Inconsistent use ofselfvsexecutorat line 406.Line 397 uses
executor.current_task, line 406 usesself.current_task. At this point they're identical sinceexecutor = selfhasn't been reassigned yet, so no bug — just a readability hiccup for anyone tracing the flow later.Suggested fix
- self.current_task = task; + executor.current_task = task;
No description provided.