Skip to content
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

Remove usage of Node domains #4633

Closed
AbhiPrasad opened this issue Feb 24, 2022 · 2 comments
Closed

Remove usage of Node domains #4633

AbhiPrasad opened this issue Feb 24, 2022 · 2 comments
Labels
Meta: Breaking Package: node Issues related to the Sentry Node SDK

Comments

@AbhiPrasad
Copy link
Member

Problem Statement

Domains are deprecated - we should switch off them.

https://nodejs.org/api/domain.html#domain

Solution Brainstorm

Async hooks are avaliable since 8.x, but at Experimental stability.

https://nodejs.org/api/async_hooks.html

When we remove Node 6 support in v7, we can evaluate making the switch

@xr0master
Copy link
Contributor

xr0master commented Mar 10, 2022

I think that the main challenge is that, thanks to the domain, a separate scoping is made, where errors are caught and breadcrumbs for this scoping. Sentry creates a scope for the process, but the node.js does not have classical parallelism, and it turns out that the scope becomes global for all incoming requests.

To remove the domain, it needs to reconsider the main concept of ​​Sentry. Create scopes for each request, and at the same time, the scopes should be stored in the hub in parallel, and not stacked on each other. I think, in order not to destroy the existing concept for other languages, it is worth replacing the scope stack with a scope tree. Such the tree store will allow us to create inheritance similar to stacks, but at the same time scopes can be parallel and inherited from the global scope.

image

@HazAT
Copy link
Member

HazAT commented Jan 25, 2023

When we work on async_hooks - we probably forget that this issue exists. Closing - but we are going to do it :)

@HazAT HazAT closed this as completed Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Meta: Breaking Package: node Issues related to the Sentry Node SDK
Projects
None yet
Development

No branches or pull requests

3 participants