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
I am using the http request and breakdown the response times using events emitted at different stages of the request/response process.
With node < 10 it used to work well. With node >= 10 it has stopped working. The on end event of the response is not called. If I remove the readable event - then it is called.
Here is a sample code of rising stack on this subject (measuring http timings). Their sample also works on node < 10 but has the same problem with node >= 10: Rising Stack sample code
Was anything changed in the way http calls are made in version 10?
Do we have a document with the changes in version 10 about this?
In the sample code I linked, the end event if not fired on version 10 but it is fired on previous versions.
Need to know what was the breaking change to adopt the code to the changes.
I have very limited connectivity this week. I can have a look next week.
Cc @mafintosh - can you have a look
Il giorno mer 20 giu 2018 alle 05:05 Anatoli Papirovski <
notifications@github.com> ha scritto:
@gonenduk I think it's due to #18994 possibly in combination of the _readableState manipulation within http. Moreover we are not really testing this use anywhere.
Activity
apapirovski commentedon Jun 20, 2018
@gonenduk there was a change around the semantics, yes. See the following section of the Streams documentation: https://nodejs.org/dist/latest-v10.x/docs/api/stream.html#stream_event_readable
apapirovski commentedon Jun 20, 2018
ping @mcollina — is this currently working fully as intended?
gonenduk commentedon Jun 20, 2018
Do we have a document with the changes in version 10 about this?
In the sample code I linked, the end event if not fired on version 10 but it is fired on previous versions.
Need to know what was the breaking change to adopt the code to the changes.
mcollina commentedon Jun 20, 2018
gonenduk commentedon Jun 28, 2018
any updates?
yosuke-furukawa commentedon Jul 2, 2018
similar issue is opened from my lib.
https://github.com/yosuke-furukawa/httpstat
http is called
endevent, but https is not calledendwhenreadableis not finished.mcollina commentedon Jul 5, 2018
I think there is a bug when using both
'readable'and'data'.gonenduk commentedon Jul 5, 2018
But why is the end event not fired with node 10 and was always fired with 8 and below?
mcollina commentedon Jul 5, 2018
@gonenduk I think it's due to #18994 possibly in combination of the
_readableStatemanipulation within http. Moreover we are not really testing this use anywhere.lundibundi commentedon Jul 6, 2018
@gonenduk until the bug is fixed, if you need it to work you can put listener on data event inside 'readable' event:
This seems to work fine.
gonenduk commentedon Jul 7, 2018
Thanks!
Adding an empty data event inside the readable event did solve the problem:
res.on('data', () => { })
The end event is fired!
stream: restore flow if there are 'data' handlers after once('readable')
stream: restore flow if there are 'data' handlers after once('readable')
Trott commentedon Aug 22, 2018
Fixed in 98cf84f
stream: restore flow if there are 'data' handlers after once('readable')
stream: restore flow if there are 'data' handlers after once('readable')
workaround for node.js bug nodejs/node#21398