Uh oh!
There was an error while loading. Please reload this page.
fix: Memoize AsyncLocalStorage instance - #8831
Conversation
size-limit report 📦
|
Lms24
left a comment
There was a problem hiding this comment.
Hmm I'm not sure but wouldn't this mean we potentially reuse the same asyncLocalStorage instance across multiple requests which we actually want to isolate? Don't have a ton of context around ALS so not sure if this concern makes sense
lforst
commented
Aug 17, 2023
Well yes, but that is theoretically not an issue. What matters is that I am trying to come up with a case where we might run into problems here, but I am struggling. I guess the baseline where this potentially messes up always involves calling |
Lms24
left a comment
There was a problem hiding this comment.
Thanks for explaining, this makes sense to me now! I'd say we give it a try and if the issue author is comfortable with trying this out locally first, it'd be even better.
lforst
commented
Aug 17, 2023
TIL the leak is likely because |
timfish
commented
Aug 17, 2023
Wouldn't this stop us or customers from overriding the async strategy after it's been set by |
timfish
commented
Aug 17, 2023
No sorry, I misundersttod the changes! |
Attempts to fix the memory leak reported in #8829 by memoizing the
AsyncLocalStorageinstance we create when setting the async context strategy.Note for reviewers: Can you think of any problems this may cause?