cloudflare / cloudflare/workerd
Question about the behavior of `AbortSignal`
Open
- Dominant language
- C++
- Stars
- 8.7k
- Forks
- 739
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 174
Description
When using `AbortSignal.timeout(ms)`, the worker stays up for the duration of the timeout (the `request_context` stays up for that long). The reported wall time will always be greater than the timeout.
Could it cause side effect if the Worker stays up for too long?
If it can cause side effect
- would there be an automatic way to abort the signal when there is no async work going on?
- if there is no automatic, would it better to instantiate an `AbortController` and call `abort` in a `setTimeout()` and when we know that the signal will not be needed any more?
/cc @danlapid @jasnell
Contributor guide
Assessment
This issue has not been assessed yet.