Skip to content

Commit 0a90804

Browse files
authored
add ctx.deferCleanup (#360)
## Why `ctx.signal.addEventListener('abort', ...)` runs _after_ the procedure span so procedures that do things like hold a lock for the duration of the proc drop the lock before cleanup runs also, abort signal order is FIFO when instead cleanup should generally be LIFO (a la Go `defer`) ultimately this reveals a bigger issue which is that we are conflating cancellation with cleanup ## What changed add ctx.deferCleanup ## Versioning - [ ] Breaking protocol change - [ ] Breaking ts/js API change <!-- Kind reminder to add tests and updated documentation if needed -->
1 parent ad8e5b0 commit 0a90804

File tree

6 files changed

+582
-13
lines changed

6 files changed

+582
-13
lines changed

0 commit comments

Comments
 (0)