{"action":"created","comment":{"url":"https://api.github.com/repos/uber/tchannel/pulls/comments/30167551","id":30167551,"diff_hunk":"@@ -226,32 +228,50 @@ TChannelRequest.prototype.resend = function resend() {\n         opts[key] = self.options[key];\n     }\n     opts.timeout = self.timeout - self.elapsed;\n-    var outReq = peer.request(opts);\n-    self.outReqs.push(outReq);\n \n-    if (self.outReqs.length === 1) {\n-        self.channel.outboundCallsSentStat.increment(1, {\n-            'target-service': outReq.serviceName,\n-            'service': outReq.headers.cn,\n-            // TODO should always be buffer\n-            'target-endpoint': String(self.arg1)\n+    self.services.onRequest(self);\n+    var conn = peer.connect();\n+    if (!peer.isConnected() && conn.handler) {\n+        var timer = self.timers.setTimeout(function connectTimeOut() {\n+            self.checkTimeout();\n+        },\n+        opts.timeout);\n+        if (timer.unref) timer.unref();\n+        conn.on('identified', function retry() {","path":"node/request.js","position":30,"original_position":30,"commit_id":"77a2c54736df7c34f8e3448185163cc02dc7bbb5","original_commit_id":"77a2c54736df7c34f8e3448185163cc02dc7bbb5","user":{"login":"jcorbin","id":49715,"avatar_url":"https://avatars.githubusercontent.com/u/49715?v=3","gravatar_id":"","url":"https://api.github.com/users/jcorbin","html_url":"https://github.com/jcorbin","followers_url":"https://api.github.com/users/jcorbin/followers","following_url":"https://api.github.com/users/jcorbin/following{/other_user}","gists_url":"https://api.github.com/users/jcorbin/gists{/gist_id}","starred_url":"https://api.github.com/users/jcorbin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcorbin/subscriptions","organizations_url":"https://api.github.com/users/jcorbin/orgs","repos_url":"https://api.github.com/users/jcorbin/repos","events_url":"https://api.github.com/users/jcorbin/events{/privacy}","received_events_url":"https://api.github.com/users/jcorbin/received_events","type":"User","site_admin":false},"body":"please call it `function onIdentified` and hoist it down","created_at":"2015-05-12T18:51:41Z","updated_at":"2015-05-12T18:51:41Z","html_url":"https://github.com/uber/tchannel/pull/560#discussion_r30167551","pull_request_url":"https://api.github.com/repos/uber/tchannel/pulls/560","_links":{"self":{"href":"https://api.github.com/repos/uber/tchannel/pulls/comments/30167551"},"html":{"href":"https://github.com/uber/tchannel/pull/560#discussion_r30167551"},"pull_request":{"href":"https://api.github.com/repos/uber/tchannel/pulls/560"}}},"pull_request":{"url":"https://api.github.com/repos/uber/tchannel/pulls/560","id":35044746,"html_url":"https://github.com/uber/tchannel/pull/560","diff_url":"https://github.com/uber/tchannel/pull/560.diff","patch_url":"https://github.com/uber/tchannel/pull/560.patch","issue_url":"https://api.github.com/repos/uber/tchannel/issues/560","number":560,"state":"open","locked":false,"title":"Error on incoming call req/res frame before init res frame is sent","user":{"login":"ShanniLi","id":5845092,"avatar_url":"https://avatars.githubusercontent.com/u/5845092?v=3","gravatar_id":"","url":"https://api.github.com/users/ShanniLi","html_url":"https://github.com/ShanniLi","followers_url":"https://api.github.com/users/ShanniLi/followers","following_url":"https://api.github.com/users/ShanniLi/following{/other_user}","gists_url":"https://api.github.com/users/ShanniLi/gists{/gist_id}","starred_url":"https://api.github.com/users/ShanniLi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShanniLi/subscriptions","organizations_url":"https://api.github.com/users/ShanniLi/orgs","repos_url":"https://api.github.com/users/ShanniLi/repos","events_url":"https://api.github.com/users/ShanniLi/events{/privacy}","received_events_url":"https://api.github.com/users/ShanniLi/received_events","type":"User","site_admin":false},"body":"r @jcorbin @Raynos \r\n\r\n1. handle the issue by moving self.sendInitResponse up. \r\n2. did a little refinement adding the typed error: TChannelInitProtocolError\r\n","created_at":"2015-05-08T20:38:51Z","updated_at":"2015-05-12T18:51:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"561012f364c5732e0e7bdfaa2ed7feddd30d4e73","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/uber/tchannel/pulls/560/commits","review_comments_url":"https://api.github.com/repos/uber/tchannel/pulls/560/comments","review_comment_url":"https://api.github.com/repos/uber/tchannel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uber/tchannel/issues/560/comments","statuses_url":"https://api.github.com/repos/uber/tchannel/statuses/77a2c54736df7c34f8e3448185163cc02dc7bbb5","head":{"label":"uber:i554","ref":"i554","sha":"77a2c54736df7c34f8e3448185163cc02dc7bbb5","user":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"repo":{"id":28419663,"name":"tchannel","full_name":"uber/tchannel","owner":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber/tchannel","description":"network multiplexing and framing protocol for RPC","fork":false,"url":"https://api.github.com/repos/uber/tchannel","forks_url":"https://api.github.com/repos/uber/tchannel/forks","keys_url":"https://api.github.com/repos/uber/tchannel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/tchannel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/tchannel/teams","hooks_url":"https://api.github.com/repos/uber/tchannel/hooks","issue_events_url":"https://api.github.com/repos/uber/tchannel/issues/events{/number}","events_url":"https://api.github.com/repos/uber/tchannel/events","assignees_url":"https://api.github.com/repos/uber/tchannel/assignees{/user}","branches_url":"https://api.github.com/repos/uber/tchannel/branches{/branch}","tags_url":"https://api.github.com/repos/uber/tchannel/tags","blobs_url":"https://api.github.com/repos/uber/tchannel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/tchannel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/tchannel/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/tchannel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/tchannel/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/tchannel/languages","stargazers_url":"https://api.github.com/repos/uber/tchannel/stargazers","contributors_url":"https://api.github.com/repos/uber/tchannel/contributors","subscribers_url":"https://api.github.com/repos/uber/tchannel/subscribers","subscription_url":"https://api.github.com/repos/uber/tchannel/subscription","commits_url":"https://api.github.com/repos/uber/tchannel/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/tchannel/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/tchannel/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/tchannel/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/tchannel/contents/{+path}","compare_url":"https://api.github.com/repos/uber/tchannel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/tchannel/merges","archive_url":"https://api.github.com/repos/uber/tchannel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/tchannel/downloads","issues_url":"https://api.github.com/repos/uber/tchannel/issues{/number}","pulls_url":"https://api.github.com/repos/uber/tchannel/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/tchannel/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/tchannel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/tchannel/labels{/name}","releases_url":"https://api.github.com/repos/uber/tchannel/releases{/id}","created_at":"2014-12-23T21:06:57Z","updated_at":"2015-05-08T19:08:09Z","pushed_at":"2015-05-12T18:43:36Z","git_url":"git://github.com/uber/tchannel.git","ssh_url":"git@github.com:uber/tchannel.git","clone_url":"https://github.com/uber/tchannel.git","svn_url":"https://github.com/uber/tchannel","homepage":"","size":17636,"stargazers_count":48,"watchers_count":48,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":71,"forks":3,"open_issues":71,"watchers":48,"default_branch":"master"}},"base":{"label":"uber:master","ref":"master","sha":"9fdd3e176b559e5ccf18aee0a171db998d9293ab","user":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"repo":{"id":28419663,"name":"tchannel","full_name":"uber/tchannel","owner":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber/tchannel","description":"network multiplexing and framing protocol for RPC","fork":false,"url":"https://api.github.com/repos/uber/tchannel","forks_url":"https://api.github.com/repos/uber/tchannel/forks","keys_url":"https://api.github.com/repos/uber/tchannel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/tchannel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/tchannel/teams","hooks_url":"https://api.github.com/repos/uber/tchannel/hooks","issue_events_url":"https://api.github.com/repos/uber/tchannel/issues/events{/number}","events_url":"https://api.github.com/repos/uber/tchannel/events","assignees_url":"https://api.github.com/repos/uber/tchannel/assignees{/user}","branches_url":"https://api.github.com/repos/uber/tchannel/branches{/branch}","tags_url":"https://api.github.com/repos/uber/tchannel/tags","blobs_url":"https://api.github.com/repos/uber/tchannel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/tchannel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/tchannel/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/tchannel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/tchannel/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/tchannel/languages","stargazers_url":"https://api.github.com/repos/uber/tchannel/stargazers","contributors_url":"https://api.github.com/repos/uber/tchannel/contributors","subscribers_url":"https://api.github.com/repos/uber/tchannel/subscribers","subscription_url":"https://api.github.com/repos/uber/tchannel/subscription","commits_url":"https://api.github.com/repos/uber/tchannel/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/tchannel/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/tchannel/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/tchannel/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/tchannel/contents/{+path}","compare_url":"https://api.github.com/repos/uber/tchannel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/tchannel/merges","archive_url":"https://api.github.com/repos/uber/tchannel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/tchannel/downloads","issues_url":"https://api.github.com/repos/uber/tchannel/issues{/number}","pulls_url":"https://api.github.com/repos/uber/tchannel/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/tchannel/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/tchannel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/tchannel/labels{/name}","releases_url":"https://api.github.com/repos/uber/tchannel/releases{/id}","created_at":"2014-12-23T21:06:57Z","updated_at":"2015-05-08T19:08:09Z","pushed_at":"2015-05-12T18:43:36Z","git_url":"git://github.com/uber/tchannel.git","ssh_url":"git@github.com:uber/tchannel.git","clone_url":"https://github.com/uber/tchannel.git","svn_url":"https://github.com/uber/tchannel","homepage":"","size":17636,"stargazers_count":48,"watchers_count":48,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":71,"forks":3,"open_issues":71,"watchers":48,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/uber/tchannel/pulls/560"},"html":{"href":"https://github.com/uber/tchannel/pull/560"},"issue":{"href":"https://api.github.com/repos/uber/tchannel/issues/560"},"comments":{"href":"https://api.github.com/repos/uber/tchannel/issues/560/comments"},"review_comments":{"href":"https://api.github.com/repos/uber/tchannel/pulls/560/comments"},"review_comment":{"href":"https://api.github.com/repos/uber/tchannel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uber/tchannel/pulls/560/commits"},"statuses":{"href":"https://api.github.com/repos/uber/tchannel/statuses/77a2c54736df7c34f8e3448185163cc02dc7bbb5"}}}}