{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/8895","repository_url":"https://api.github.com/repos/nodejs/node","labels_url":"https://api.github.com/repos/nodejs/node/issues/8895/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/8895/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/8895/events","html_url":"https://github.com/nodejs/node/pull/8895","id":180506021,"number":8895,"title":"http: set socket timeout when socket connects","user":{"login":"lpinca","id":1443911,"avatar_url":"https://avatars.githubusercontent.com/u/1443911?v=3","gravatar_id":"","url":"https://api.github.com/users/lpinca","html_url":"https://github.com/lpinca","followers_url":"https://api.github.com/users/lpinca/followers","following_url":"https://api.github.com/users/lpinca/following{/other_user}","gists_url":"https://api.github.com/users/lpinca/gists{/gist_id}","starred_url":"https://api.github.com/users/lpinca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lpinca/subscriptions","organizations_url":"https://api.github.com/users/lpinca/orgs","repos_url":"https://api.github.com/users/lpinca/repos","events_url":"https://api.github.com/users/lpinca/events{/privacy}","received_events_url":"https://api.github.com/users/lpinca/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nodejs/node/labels/http","name":"http","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-10-02T10:34:26Z","updated_at":"2016-10-08T20:43:52Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/nodejs/node/pulls/8895","html_url":"https://github.com/nodejs/node/pull/8895","diff_url":"https://github.com/nodejs/node/pull/8895.diff","patch_url":"https://github.com/nodejs/node/pull/8895.patch"},"body":"<!--\r\nThank you for your pull request. Please review below requirements.\r\n\r\nBug fixes and new features should include tests and possibly benchmarks.\r\n\r\nContributors guide: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md\r\n-->\r\n\r\n##### Checklist\r\n<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->\r\n\r\n- [x] `make -j8 test` (UNIX), or `vcbuild test nosign` (Windows) passes\r\n- [x] tests and/or benchmarks are included\r\n- [x] commit message follows commit guidelines\r\n\r\n##### Affected core subsystem(s)\r\n<!-- Provide affected core subsystem(s) (like doc, cluster, crypto, etc). -->\r\nhttp\r\n\r\n##### Description of change\r\n<!-- Provide a description of the change below this comment. -->\r\n\r\n`request.setTimeout()` calls `socket.setTimeout()` as soon as a socket is assigned to the request. This makes the `timeout` event to be emitted on the request even if the underlying socket never connects.\r\n\r\nThis commit makes `socket.setTimeout()` to be called only when the underlying socket is connected."},"comment":{"url":"https://api.github.com/repos/nodejs/node/issues/comments/252447356","html_url":"https://github.com/nodejs/node/pull/8895#issuecomment-252447356","issue_url":"https://api.github.com/repos/nodejs/node/issues/8895","id":252447356,"user":{"login":"lpinca","id":1443911,"avatar_url":"https://avatars.githubusercontent.com/u/1443911?v=3","gravatar_id":"","url":"https://api.github.com/users/lpinca","html_url":"https://github.com/lpinca","followers_url":"https://api.github.com/users/lpinca/followers","following_url":"https://api.github.com/users/lpinca/following{/other_user}","gists_url":"https://api.github.com/users/lpinca/gists{/gist_id}","starred_url":"https://api.github.com/users/lpinca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lpinca/subscriptions","organizations_url":"https://api.github.com/users/lpinca/orgs","repos_url":"https://api.github.com/users/lpinca/repos","events_url":"https://api.github.com/users/lpinca/events{/privacy}","received_events_url":"https://api.github.com/users/lpinca/received_events","type":"User","site_admin":false},"created_at":"2016-10-08T20:43:51Z","updated_at":"2016-10-08T20:43:51Z","body":"@indutny yes it makes sense. I know that some userland modules use an additional timer that is cleared when the `connect` event is emitted to handle cases like the one you are describing.\r\n\r\nShould I open a new PR to always set the timeout without waiting for the `connect` event? If so should this one be closed?"}}
{"actor":{"display_login":"lpinca"}}