You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CLS store gets reset on the first callback in http scenario #32060
Thanks @HarshithaKP , it's weird. I'll take a look. But It seems you are using an older version of the API. Did you compile Node.js from sources or did you use the userland module I created to test the API?
@vdeturckheim, thanks for the quick response. I am on Node.js master built from source. My HEAD is at d4e4480093319f6d8f3a26be6aad8c02eb7d589a, were there recent changes went it ?
and now it fails.
CC @mcollina@Qard and @Flarna who understand this mechanism better than me:
basically the resource in the second call to res.on('data', () => { does not seem to be gne through the hook even if it has the same id as the resource on the line before.
I did a fast look and it seems there is still an issue related to reuse of HTTPParser. On my local machine above test fails on second data event because executionAsyncResource() returns an HTTPParser but hooked[executionAsyncId()] returns an instance of HTTPClientAsyncResource.
Activity
vdeturckheim commentedon Mar 3, 2020
Thanks @HarshithaKP , it's weird. I'll take a look. But It seems you are using an older version of the API. Did you compile Node.js from sources or did you use the userland module I created to test the API?
HarshithaKP commentedon Mar 3, 2020
@vdeturckheim, thanks for the quick response. I am on Node.js master built from source. My HEAD is at d4e4480093319f6d8f3a26be6aad8c02eb7d589a, were there recent changes went it ?
vdeturckheim commentedon Mar 3, 2020
@HarshithaKP I managed to isolate the bug in
executionAsyncResource()(which is the underlying API used byAsyncLocalStorage:I updated the test
test/async-hooks/test-async-exec-resource-http.js:and now it fails.
CC @mcollina @Qard and @Flarna who understand this mechanism better than me:
basically the resource in the second call to
res.on('data', () => {does not seem to be gne through the hook even if it has the same id as the resource on the line before.Flarna commentedon Mar 3, 2020
I did a fast look and it seems there is still an issue related to reuse of HTTPParser. On my local machine above test fails on second
dataevent becauseexecutionAsyncResource()returns anHTTPParserbuthooked[executionAsyncId()]returns an instance ofHTTPClientAsyncResource.addaleax commentedon Mar 3, 2020
Pretty sure this is an oversight in the PR that added
executionAsyncResource(). I’ll open a PR.src: pass resource object along with InternalMakeCallback
addaleax commentedon Mar 3, 2020
#32063, with the test copied from above.
vdeturckheim commentedon Mar 3, 2020
Thanks a lot @addaleax !
test: add new scenario for async-local storage
src: pass resource object along with InternalMakeCallback
test: add new scenario for async-local storage
3 remaining items
test: add new scenario for async-local storage
src: pass resource object along with InternalMakeCallback
src: pass resource object along with InternalMakeCallback
test: add new scenario for async-local storage
src: pass resource object along with InternalMakeCallback
test: add new scenario for async-local storage
src: pass resource object along with InternalMakeCallback
test: add new scenario for async-local storage
src: pass resource object along with InternalMakeCallback