feat: add event loop block notifications and env flag#2842
Conversation
Add colored console warnings when the event loop is blocked and wire a feature flag to enable/disable notifications- Introduce notifyEventLoopBlocked() in eventLoopMonitor.server.ts to log a colored warning with blocked and async type. - Call notifyEventLoopBlocked() when an event-loop stall is detected. - Add EVENT_LOOP_MONITOR_NOTIFY_ENABLED to env schema with a default of "0" so notifications are off by default. This makes it easier to spot long event-loop stalls during development or when notifications are explicitly enabled.
|
|
Warning Rate limit exceeded@ericallam has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 0 minutes and 34 seconds before requesting another review. ⌛ 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. 📒 Files selected for processing (2)
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 |
PR Review: feat: add event loop block notifications and env flagThanks for this PR! Adding colored console warnings for event loop blocking is a nice debugging enhancement. Here's my review: ✅ What looks good
💡 Suggestions for improvement
🔍 Code quality observations
❓ Questions
SummaryThis is a solid, low-risk enhancement. The implementation follows existing patterns and is disabled by default. Consider the logger vs console.warn tradeoff, but the current approach is acceptable for a debugging feature meant to be eye-catching. Recommendation: ✅ Approve with optional suggestions |
Review CompleteYour review story is ready! Comment !reviewfast on this PR to re-generate the story. |
Add colored console warnings when the event loop is blocked and wire
a feature flag to enable/disable notifications- Introduce notifyEventLoopBlocked() in eventLoopMonitor.server.ts to
log a colored warning with blocked and async type.
"0" so notifications are off by default.
EVENT_LOOP_MONITOR_THRESHOLD_MSenv varThis makes it easier to spot long event-loop stalls during development
or when notifications are explicitly enabled.