{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/21398","repository_url":"https://api.github.com/repos/nodejs/node","labels_url":"https://api.github.com/repos/nodejs/node/issues/21398/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/21398/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/21398/events","html_url":"https://github.com/nodejs/node/issues/21398","id":333538911,"node_id":"MDU6SXNzdWUzMzM1Mzg5MTE=","number":21398,"title":"http request 'end' event not fired","user":{"login":"gonenduk","id":1597854,"node_id":"MDQ6VXNlcjE1OTc4NTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1597854?v=4","gravatar_id":"","url":"https://api.github.com/users/gonenduk","html_url":"https://github.com/gonenduk","followers_url":"https://api.github.com/users/gonenduk/followers","following_url":"https://api.github.com/users/gonenduk/following{/other_user}","gists_url":"https://api.github.com/users/gonenduk/gists{/gist_id}","starred_url":"https://api.github.com/users/gonenduk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gonenduk/subscriptions","organizations_url":"https://api.github.com/users/gonenduk/orgs","repos_url":"https://api.github.com/users/gonenduk/repos","events_url":"https://api.github.com/users/gonenduk/events{/privacy}","received_events_url":"https://api.github.com/users/gonenduk/received_events","type":"User","site_admin":false},"labels":[{"id":155267422,"node_id":"MDU6TGFiZWwxNTUyNjc0MjI=","url":"https://api.github.com/repos/nodejs/node/labels/http","name":"http","color":"c7def8","default":false},{"id":151728679,"node_id":"MDU6TGFiZWwxNTE3Mjg2Nzk=","url":"https://api.github.com/repos/nodejs/node/labels/question","name":"question","color":"cc317c","default":true},{"id":155435883,"node_id":"MDU6TGFiZWwxNTU0MzU4ODM=","url":"https://api.github.com/repos/nodejs/node/labels/stream","name":"stream","color":"c7def8","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-06-19T06:47:01Z","updated_at":"2018-07-02T06:34:22Z","closed_at":null,"author_association":"MEMBER","body":"Hi,\r\n\r\nI am using the http request and breakdown the response times using events emitted at different stages of the request/response process.\r\nWith 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.\r\n\r\nHere 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:\r\n[Rising Stack sample code](https://github.com/RisingStack/example-http-timings/blob/master/app.js)\r\n\r\nWas anything changed in the way http calls are made in version 10?\r\n"},"comment":{"url":"https://api.github.com/repos/nodejs/node/issues/comments/401685666","html_url":"https://github.com/nodejs/node/issues/21398#issuecomment-401685666","issue_url":"https://api.github.com/repos/nodejs/node/issues/21398","id":401685666,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMTY4NTY2Ng==","user":{"login":"yosuke-furukawa","id":555645,"node_id":"MDQ6VXNlcjU1NTY0NQ==","avatar_url":"https://avatars0.githubusercontent.com/u/555645?v=4","gravatar_id":"","url":"https://api.github.com/users/yosuke-furukawa","html_url":"https://github.com/yosuke-furukawa","followers_url":"https://api.github.com/users/yosuke-furukawa/followers","following_url":"https://api.github.com/users/yosuke-furukawa/following{/other_user}","gists_url":"https://api.github.com/users/yosuke-furukawa/gists{/gist_id}","starred_url":"https://api.github.com/users/yosuke-furukawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yosuke-furukawa/subscriptions","organizations_url":"https://api.github.com/users/yosuke-furukawa/orgs","repos_url":"https://api.github.com/users/yosuke-furukawa/repos","events_url":"https://api.github.com/users/yosuke-furukawa/events{/privacy}","received_events_url":"https://api.github.com/users/yosuke-furukawa/received_events","type":"User","site_admin":false},"created_at":"2018-07-02T06:34:22Z","updated_at":"2018-07-02T06:34:22Z","author_association":"MEMBER","body":"similar issue is opened from my lib.\r\nhttps://github.com/yosuke-furukawa/httpstat\r\n\r\nhttp is called `end` event, but https is not called `end` when `readable` is not finished.\r\n\r\n```javascript\r\n\r\n    const req = protocol.request(url, (res) => {\r\n      res.once('readable', () => {\r\n        onTransfer = Date.now();\r\n      });\r\n      res.on('data', (chunk) => {\r\n        body += chunk;\r\n      });\r\n      res.on('end', () => {\r\n        onTotal = Date.now();\r\n        res.body = body;\r\n        resolve({\r\n          url: url,\r\n          response: res,\r\n          time: {\r\n            begin: begin,\r\n            onLookup: onLookup,\r\n            onConnect: onConnect,\r\n            onSecureConnect: onSecureConnect,\r\n            onTransfer: onTransfer,\r\n            onTotal: onTotal,\r\n          }\r\n        });\r\n      });\r\n    });\r\n\r\n```"}}
{"actor":{"display_login":"yosuke-furukawa"}}