Open znewsham opened 1 year ago
I love gnarly hacks. This change definitely looks more promising than the other PR. I'm not cutting more releases at this time but I'll make sure to take a note of the change in case anyone else runs into the same issues. Thank you for the contribution.
I know the project is dying, feel free to ignore this PR (I need it for my work on
AsyncResources
and it seems generally relevant)The existing save/restore stack looses the reference to the actual
AsyncResource
- if you try to use (for example)AsyncLocalStorage
- it will fail because the current asyncResource is undefined (even though the ID is).This PR adds one more gnarly hack to these functions - to grab the existing
AsyncResource
then manually push it back onto the stack.I modified the async_hooks test to check for this too. All the tests that were passing before are passing now (for some reason pool and cleanup fail for me on master).