You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
system suspension is detected as a blocked event loop #13
Run node instance with eventLoopBlockIntegration enabled on Google Cloud Run with the instance in request billing mode. This will also work from a laptop.
Observe EventLoopBlocked notifications every time the system suspends.
Expected Result
System suspension should not be detected as a blocked event loop.
Actual Result
System suspension is detected and reported as a blocked event loop
Additional information
The event loop block integration currently uses std::chrono::system_clock::now() for detecting when the event loop is blocked (code). On linux, Gcc's libstdc++ uses clock_gettime() with CLOCK_REALTIME to or gettimeofday() get the time depending on the settings. The documentation specifically states that CLOCK_MONOTONIC can be used to ignore time when the system is suspended. The std::chrono::steady_clock::now() implementation on linux uses this call, but on macos llvm's libcxx specifically choosesCLOCK_MONOTONIC_RAW on that platform so that the clock tracks suspends (docs). On macos you want CLOCK_UPTIME_RAW or CLOCK_UPTIME_RAW_APPROX. On windows you want QueryUnbiasedInterruptTimePercise() or QueryUnbiasedInterruptTime().
So basically, you need to implement a custom time function that does the right thing on each platform as there doesn't appear to be one in the standard library.
Activity
matthew-nicholson-anrok commentedon Jul 25, 2025
I took a pass at fixing this in #14.
[-]system suspension is detected as[/-][+]system suspension is detected as a blocked event loop[/+]timfish commentedon Jul 27, 2025
Sorry, it appears I didn't have notifications enabled for this repository so I completely missed this. I'll take a look at the PR next week!