Identify async_hooks use cases beyond AsyncLocalStorage
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- nodejs
- Domain
- observability-sre
Research direction
Start by reviewing the async_hooks and AsyncLocalStorage use cases listed in the issue, then investigate the Clinic uses mentioned in the discussion. Done means documenting additional use cases and identifying which safer APIs could address them without exposing unsafe resource internals.
Written by the indexing model from the issue text.
Description
It seems to be the general consensus of this working group that async_hooks should not be directly made stable due to it exposing internals. The AsyncLocalStorage API provides a higher-level solution to many of the use cases of async_hooks, however some use cases still remain. I would like to identify what those use cases are so we can introduce safer APIs solving those problems and eventually move toward deprecating direct use of async_hooks or perhaps just the unsafe aspects of it.
Known use cases:
- long stack traces
- Shouldn't make any use of the resource objects, so should be reasonably safe.
- tracking handle lifecycle
- The subsystem type, id, and event timings can be used to track high-level lifecycle safely
- Deeper awareness may involve inspecting the resource object, which could be unsafe
- measure time spent in blocking code
- Mainly just need timing between before/after and maybe type for extra context, resource not required
What other use cases are there? I know clinic uses it for some things, perhaps @mcollina has some insight on that?
- Dominant language
- No language data
- Stars
- 550
- Forks
- 69
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nodejs/diagnostics
-
Difficulty 1/5 Under an hour Newbie friendliness 65/100
nodejs/diagnostics#648 · 3 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 20/100
nodejs/diagnostics#690 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 20/100
nodejs/diagnostics#689 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 25/100
nodejs/diagnostics#688 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
nodejs/diagnostics#687 ·
All issues in nodejs/diagnostics
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
needs-triage🔍
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
triage_needed
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
awslabs/graphrag-toolkit#572 ·
-
priority:p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
copse-dev/agent-pane#2933 ·
-
enhancement p2 setup
Difficulty 2/5 1-3 hours Newbie friendliness 82/100