Skip to content

when tracking threads, use a monotonic clock that ignores system suspension #14

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

Merged
merged 2 commits into from
Jul 28, 2025

Conversation

matthew-nicholson-anrok
Copy link
Contributor

@matthew-nicholson-anrok matthew-nicholson-anrok commented Jul 25, 2025

Using the system time causes each suspension to be detected as an event loop delay which is not useful. System suspensions may be common when running in low cost cloud environments where systems are suspended when not actively serving requests.

Closes #13

Testing

I am only able to test on macos currently, but the code seems to work as expected there.

  • suspend machine with eventLoopBlockIntegration enabled, ensure no event is triggered when resuming
    • test on linux
    • test on macos
    • test on windows
  • run function to delay event loop, ensure event is triggered
    • test on linux
    • test on macos
    • test on windows

…ension

Using the system time causes each suspension to be detected as an event
loop delay which is not useful. System suspensions may be common when
running in low cost cloud environments where systems are suspended when
not actively serving requests.
@timfish

This comment was marked as outdated.

@timfish
Copy link
Collaborator

timfish commented Jul 28, 2025

I've fixed the Windows build from my Windows machine but couldn't push changes to your branch.

Here is the patch:
sentry-javascript-node-native-stacktrace-cd5895f-Fix Windows build.patch

@matthew-nicholson-anrok
Copy link
Contributor Author

@timfish awesome! I've updated the PR with your patch.

@timfish timfish requested a review from AbhiPrasad July 28, 2025 20:10
Copy link
Collaborator

@timfish timfish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this great contribution!

Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, good stuff @matthew-nicholson-anrok thank you!

@AbhiPrasad AbhiPrasad merged commit cf4aa0f into getsentry:main Jul 28, 2025
57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

system suspension is detected as a blocked event loop
3 participants