{"action":"created","comment":{"url":"https://api.github.com/repos/uber/tchannel-node/pulls/comments/40247983","id":40247983,"diff_hunk":"@@ -614,4 +623,24 @@ function sendLazyErrorFrame(reqFrame, codeString, message) {\n         codeString, message);\n };\n \n+TChannelConnection.prototype._drain =\n+function _drain(reason, exempt) {\n+    var self = this;\n+\n+    TChannelConnectionBase.prototype._drain.call(self, reason, exempt);\n+\n+    if (self.remoteName) {\n+        sendDrainingFrame();\n+    } else {\n+        self.identifiedEvent.on(sendDrainingFrame);\n+    }\n+\n+    function sendDrainingFrame() {\n+        self.handler.sendErrorFrame(\n+            v2.Frame.NullId, null,\n+            'Declined',","path":"connection.js","position":40,"original_position":40,"commit_id":"066c7d0d270ef3b63c11c2297e20b6916dc83e5a","original_commit_id":"066c7d0d270ef3b63c11c2297e20b6916dc83e5a","user":{"login":"Raynos","id":479538,"avatar_url":"https://avatars.githubusercontent.com/u/479538?v=3","gravatar_id":"","url":"https://api.github.com/users/Raynos","html_url":"https://github.com/Raynos","followers_url":"https://api.github.com/users/Raynos/followers","following_url":"https://api.github.com/users/Raynos/following{/other_user}","gists_url":"https://api.github.com/users/Raynos/gists{/gist_id}","starred_url":"https://api.github.com/users/Raynos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Raynos/subscriptions","organizations_url":"https://api.github.com/users/Raynos/orgs","repos_url":"https://api.github.com/users/Raynos/repos","events_url":"https://api.github.com/users/Raynos/events{/privacy}","received_events_url":"https://api.github.com/users/Raynos/received_events","type":"User","site_admin":false},"body":"Declined or NetworkError ? ","created_at":"2015-09-23T19:42:42Z","updated_at":"2015-09-23T19:42:42Z","html_url":"https://github.com/uber/tchannel-node/pull/9#discussion_r40247983","pull_request_url":"https://api.github.com/repos/uber/tchannel-node/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/uber/tchannel-node/pulls/comments/40247983"},"html":{"href":"https://github.com/uber/tchannel-node/pull/9#discussion_r40247983"},"pull_request":{"href":"https://api.github.com/repos/uber/tchannel-node/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/uber/tchannel-node/pulls/9","id":45818953,"html_url":"https://github.com/uber/tchannel-node/pull/9","diff_url":"https://github.com/uber/tchannel-node/pull/9.diff","patch_url":"https://github.com/uber/tchannel-node/pull/9.patch","issue_url":"https://api.github.com/repos/uber/tchannel-node/issues/9","number":9,"state":"open","locked":false,"title":"Add a draining \"signal\" frame","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":"When a connection starts draining, send a null-id'd declined error frame.\r\n\r\nNote the message prefix is going to become a contract, since really this would be better off as a new frame type entirely; subsequent PR will branch essentially on \"if the error has null id, and is declined, and the message starts with \"draining:\".\r\n\r\nr @Raynos \r\ncc @blampe @prashantv @junchaowu ","created_at":"2015-09-23T19:12:14Z","updated_at":"2015-09-23T19:42:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6027ceee1091f17263a26e5cc3b8b02b4a24baeb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/uber/tchannel-node/pulls/9/commits","review_comments_url":"https://api.github.com/repos/uber/tchannel-node/pulls/9/comments","review_comment_url":"https://api.github.com/repos/uber/tchannel-node/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uber/tchannel-node/issues/9/comments","statuses_url":"https://api.github.com/repos/uber/tchannel-node/statuses/066c7d0d270ef3b63c11c2297e20b6916dc83e5a","head":{"label":"uber:drain_signal","ref":"drain_signal","sha":"066c7d0d270ef3b63c11c2297e20b6916dc83e5a","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":42619114,"name":"tchannel-node","full_name":"uber/tchannel-node","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-node","description":"","fork":false,"url":"https://api.github.com/repos/uber/tchannel-node","forks_url":"https://api.github.com/repos/uber/tchannel-node/forks","keys_url":"https://api.github.com/repos/uber/tchannel-node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/tchannel-node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/tchannel-node/teams","hooks_url":"https://api.github.com/repos/uber/tchannel-node/hooks","issue_events_url":"https://api.github.com/repos/uber/tchannel-node/issues/events{/number}","events_url":"https://api.github.com/repos/uber/tchannel-node/events","assignees_url":"https://api.github.com/repos/uber/tchannel-node/assignees{/user}","branches_url":"https://api.github.com/repos/uber/tchannel-node/branches{/branch}","tags_url":"https://api.github.com/repos/uber/tchannel-node/tags","blobs_url":"https://api.github.com/repos/uber/tchannel-node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/tchannel-node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/tchannel-node/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/tchannel-node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/tchannel-node/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/tchannel-node/languages","stargazers_url":"https://api.github.com/repos/uber/tchannel-node/stargazers","contributors_url":"https://api.github.com/repos/uber/tchannel-node/contributors","subscribers_url":"https://api.github.com/repos/uber/tchannel-node/subscribers","subscription_url":"https://api.github.com/repos/uber/tchannel-node/subscription","commits_url":"https://api.github.com/repos/uber/tchannel-node/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/tchannel-node/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/tchannel-node/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/tchannel-node/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/tchannel-node/contents/{+path}","compare_url":"https://api.github.com/repos/uber/tchannel-node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/tchannel-node/merges","archive_url":"https://api.github.com/repos/uber/tchannel-node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/tchannel-node/downloads","issues_url":"https://api.github.com/repos/uber/tchannel-node/issues{/number}","pulls_url":"https://api.github.com/repos/uber/tchannel-node/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/tchannel-node/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/tchannel-node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/tchannel-node/labels{/name}","releases_url":"https://api.github.com/repos/uber/tchannel-node/releases{/id}","created_at":"2015-09-16T23:37:37Z","updated_at":"2015-09-23T04:28:19Z","pushed_at":"2015-09-23T19:24:14Z","git_url":"git://github.com/uber/tchannel-node.git","ssh_url":"git@github.com:uber/tchannel-node.git","clone_url":"https://github.com/uber/tchannel-node.git","svn_url":"https://github.com/uber/tchannel-node","homepage":null,"size":0,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":2,"default_branch":"master"}},"base":{"label":"uber:master","ref":"master","sha":"887ba3169ea011549d4a3cc1e70fded9f40fd20c","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":42619114,"name":"tchannel-node","full_name":"uber/tchannel-node","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-node","description":"","fork":false,"url":"https://api.github.com/repos/uber/tchannel-node","forks_url":"https://api.github.com/repos/uber/tchannel-node/forks","keys_url":"https://api.github.com/repos/uber/tchannel-node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/tchannel-node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/tchannel-node/teams","hooks_url":"https://api.github.com/repos/uber/tchannel-node/hooks","issue_events_url":"https://api.github.com/repos/uber/tchannel-node/issues/events{/number}","events_url":"https://api.github.com/repos/uber/tchannel-node/events","assignees_url":"https://api.github.com/repos/uber/tchannel-node/assignees{/user}","branches_url":"https://api.github.com/repos/uber/tchannel-node/branches{/branch}","tags_url":"https://api.github.com/repos/uber/tchannel-node/tags","blobs_url":"https://api.github.com/repos/uber/tchannel-node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/tchannel-node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/tchannel-node/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/tchannel-node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/tchannel-node/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/tchannel-node/languages","stargazers_url":"https://api.github.com/repos/uber/tchannel-node/stargazers","contributors_url":"https://api.github.com/repos/uber/tchannel-node/contributors","subscribers_url":"https://api.github.com/repos/uber/tchannel-node/subscribers","subscription_url":"https://api.github.com/repos/uber/tchannel-node/subscription","commits_url":"https://api.github.com/repos/uber/tchannel-node/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/tchannel-node/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/tchannel-node/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/tchannel-node/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/tchannel-node/contents/{+path}","compare_url":"https://api.github.com/repos/uber/tchannel-node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/tchannel-node/merges","archive_url":"https://api.github.com/repos/uber/tchannel-node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/tchannel-node/downloads","issues_url":"https://api.github.com/repos/uber/tchannel-node/issues{/number}","pulls_url":"https://api.github.com/repos/uber/tchannel-node/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/tchannel-node/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/tchannel-node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/tchannel-node/labels{/name}","releases_url":"https://api.github.com/repos/uber/tchannel-node/releases{/id}","created_at":"2015-09-16T23:37:37Z","updated_at":"2015-09-23T04:28:19Z","pushed_at":"2015-09-23T19:24:14Z","git_url":"git://github.com/uber/tchannel-node.git","ssh_url":"git@github.com:uber/tchannel-node.git","clone_url":"https://github.com/uber/tchannel-node.git","svn_url":"https://github.com/uber/tchannel-node","homepage":null,"size":0,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/uber/tchannel-node/pulls/9"},"html":{"href":"https://github.com/uber/tchannel-node/pull/9"},"issue":{"href":"https://api.github.com/repos/uber/tchannel-node/issues/9"},"comments":{"href":"https://api.github.com/repos/uber/tchannel-node/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/uber/tchannel-node/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/uber/tchannel-node/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uber/tchannel-node/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/uber/tchannel-node/statuses/066c7d0d270ef3b63c11c2297e20b6916dc83e5a"}}}}