Title: system suspension is detected as a blocked event loop · Issue #13 · getsentry/sentry-javascript-node-native-stacktrace · GitHub
Open Graph Title: system suspension is detected as a blocked event loop · Issue #13 · getsentry/sentry-javascript-node-native-stacktrace
X Title: system suspension is detected as a blocked event loop · Issue #13 · getsentry/sentry-javascript-node-native-stacktrace
Description: Environment @sentry-internal/node-native-stacktrace@npm:0.2.1 On linux and macos. Steps to Reproduce Enable eventLoopBlockIntegration. Run node instance with eventLoopBlockIntegration enabled on Google Cloud Run with the instance in requ...
Open Graph Description: Environment @sentry-internal/node-native-stacktrace@npm:0.2.1 On linux and macos. Steps to Reproduce Enable eventLoopBlockIntegration. Run node instance with eventLoopBlockIntegration enabled on Go...
X Description: Environment @sentry-internal/node-native-stacktrace@npm:0.2.1 On linux and macos. Steps to Reproduce Enable eventLoopBlockIntegration. Run node instance with eventLoopBlockIntegration enabled on Go...
Opengraph URL: https://github.com/getsentry/sentry-javascript-node-native-stacktrace/issues/13
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"system suspension is detected as a blocked event loop","articleBody":"### Environment\n\n@sentry-internal/node-native-stacktrace@npm:0.2.1\n\nOn linux and macos.\n\n### Steps to Reproduce\n\n1. Enable [eventLoopBlockIntegration](https://docs.sentry.io/platforms/javascript/guides/react-router/configuration/event-loop-block/).\n2. Run node instance with eventLoopBlockIntegration enabled on Google Cloud Run with the instance in request billing mode. This will also work from a laptop.\n3. Observe EventLoopBlocked notifications every time the system suspends.\n\n### Expected Result\n\nSystem suspension should not be detected as a blocked event loop.\n\n### Actual Result\n\nSystem suspension is detected and reported as a blocked event loop\n\n### Additional information\n\nThe event loop block integration currently uses `std::chrono::system_clock::now()` for detecting when the event loop is blocked ([code](https://github.com/getsentry/sentry-javascript-node-native-stacktrace/blob/56f301aeb5be6d4084bd31683b41fd90373fb8b5/module.cc#L279)). On linux, Gcc's libstdc++ uses [`clock_gettime()`](https://www.man7.org/linux/man-pages/man3/clock_gettime.3.html) 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 chooses](https://github.com/llvm/llvm-project/blob/4ae26783724a8cb29b448920f5b4066ebbbf3a95/libcxx/src/chrono.cpp#L175-L185) `CLOCK_MONOTONIC_RAW` on that platform so that the clock tracks suspends ([docs](https://www.manpagez.com/man/3/clock_gettime_nsec_np/)). On macos you want `CLOCK_UPTIME_RAW` or `CLOCK_UPTIME_RAW_APPROX`. On windows you want [`QueryUnbiasedInterruptTimePercise()`](https://learn.microsoft.com/en-us/windows/win32/api/realtimeapiset/nf-realtimeapiset-queryunbiasedinterrupttimeprecise) or [`QueryUnbiasedInterruptTime()`](https://learn.microsoft.com/en-us/windows/win32/api/realtimeapiset/nf-realtimeapiset-queryunbiasedinterrupttime).\n\nSo 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.","author":{"url":"https://github.com/matthew-nicholson-anrok","@type":"Person","name":"matthew-nicholson-anrok"},"datePublished":"2025-07-25T00:39:43.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/13/sentry-javascript-node-native-stacktrace/issues/13"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:31d7f285-81fa-3b34-9225-260975feaa16 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9106:3F4FF7:1B1B6:226AE:696B3147 |
| html-safe-nonce | 068d73524cfd6aef50bc466ff6bc52c4fa50d19f7723552c6477c3288eb14711 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MTA2OjNGNEZGNzoxQjFCNjoyMjZBRTo2OTZCMzE0NyIsInZpc2l0b3JfaWQiOiIzOTMzMzgxNjg5MTA5ODUyNDg3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | bf23bf68f108aa3229eed4a7238b5a04b05b134b6d724f2cc3c618bffa60cd90 |
| hovercard-subject-tag | issue:3261597969 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript-node-native-stacktrace/13/issue_layout |
| twitter:image | https://opengraph.githubassets.com/98c22c1960b199e074a312e65b0b742e9e5e91cefb12574b6316188fbaa44a0d/getsentry/sentry-javascript-node-native-stacktrace/issues/13 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/98c22c1960b199e074a312e65b0b742e9e5e91cefb12574b6316188fbaa44a0d/getsentry/sentry-javascript-node-native-stacktrace/issues/13 |
| og:image:alt | Environment @sentry-internal/node-native-stacktrace@npm:0.2.1 On linux and macos. Steps to Reproduce Enable eventLoopBlockIntegration. Run node instance with eventLoopBlockIntegration enabled on Go... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | matthew-nicholson-anrok |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript-node-native-stacktrace git https://github.com/getsentry/sentry-javascript-node-native-stacktrace.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 990851629 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript-node-native-stacktrace |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 990851629 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript-node-native-stacktrace |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width