-
Notifications
You must be signed in to change notification settings - Fork 30.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
async_hooks: AsyncLocalStorage store does not get GC. #54351
Comments
cc @Qard @legendecas |
Closing, the test does not prove anything, as the following fails as well: 'use strict'
const { test } = require('node:test')
const { AsyncLocalStorage } = require('node:async_hooks')
const { setImmediate } = require('node:timers/promises')
const assert = require('node:assert')
test('clone body garbage collection', async () => {
const asyncLocalStorage = new AsyncLocalStorage()
let ref = new WeakRef(new Map())
// await asyncLocalStorage.run(ref.deref(), async () => {})
for (let i = 0; i < 1000; i++) {
await setImmediate()
global.gc(true)
}
assert.equal(ref.deref(), undefined, 'store was not garbage collected')
}) |
The reason is If this is meant to be a minimal replication of a |
For some unknown reasons,
AsyncLocalStorage
store object does not get gc'ed correctly:This test fails.
The text was updated successfully, but these errors were encountered: