payload: {"action":"created","comment":{"url":"https://api.github.com/repos/pinterest/elixir-thrift/pulls/comments/324949059","pull_request_review_id":288979212,"id":324949059,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMyNDk0OTA1OQ==","diff_hunk":"@@ -372,4 +401,34 @@ defmodule Thrift.Binary.Framed.Client do\n         {:stop, error, s}\n     end\n   end\n+\n+  defp maybe_resend_data({:ok, s}, {:reconnect, :call, msg, from}) do\n+    case handle_call(msg, from, s) do\n+      {:reply, reply, s} ->\n+        GenServer.reply(from, reply)\n+        {:ok, s}\n+\n+      {:disconnect, info, error, s} ->\n+        GenServer.reply(from, error)\n+        disconnect(info, s)\n+\n+      _ ->","path":"lib/thrift/binary/framed/client.ex","position":141,"original_position":141,"commit_id":"2a468b2a999c81f84c0271939a3a812d90b9c48a","original_commit_id":"2a468b2a999c81f84c0271939a3a812d90b9c48a","user":{"login":"fishcakez","id":2001229,"node_id":"MDQ6VXNlcjIwMDEyMjk=","avatar_url":"https://avatars3.githubusercontent.com/u/2001229?v=4","gravatar_id":"","url":"https://api.github.com/users/fishcakez","html_url":"https://github.com/fishcakez","followers_url":"https://api.github.com/users/fishcakez/followers","following_url":"https://api.github.com/users/fishcakez/following{/other_user}","gists_url":"https://api.github.com/users/fishcakez/gists{/gist_id}","starred_url":"https://api.github.com/users/fishcakez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fishcakez/subscriptions","organizations_url":"https://api.github.com/users/fishcakez/orgs","repos_url":"https://api.github.com/users/fishcakez/repos","events_url":"https://api.github.com/users/fishcakez/events{/privacy}","received_events_url":"https://api.github.com/users/fishcakez/received_events","type":"User","site_admin":false},"body":"The handle call could return `{:connect, _, _, _}` here, and we seem to do the wrong thing by returning an ok socket.\r\n\r\nFor example it could be possible due to a server side bug that the server always closes the connection without sending a response for certain requests - and we would always be seeing it.","created_at":"2019-09-17T01:33:56Z","updated_at":"2019-09-17T01:38:07Z","html_url":"https://github.com/pinterest/elixir-thrift/pull/478#discussion_r324949059","pull_request_url":"https://api.github.com/repos/pinterest/elixir-thrift/pulls/478","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/pinterest/elixir-thrift/pulls/comments/324949059"},"html":{"href":"https://github.com/pinterest/elixir-thrift/pull/478#discussion_r324949059"},"pull_request":{"href":"https://api.github.com/repos/pinterest/elixir-thrift/pulls/478"}}},"pull_request":{"url":"https://api.github.com/repos/pinterest/elixir-thrift/pulls/478","id":317987658,"node_id":"MDExOlB1bGxSZXF1ZXN0MzE3OTg3NjU4","html_url":"https://github.com/pinterest/elixir-thrift/pull/478","diff_url":"https://github.com/pinterest/elixir-thrift/pull/478.diff","patch_url":"https://github.com/pinterest/elixir-thrift/pull/478.patch","issue_url":"https://api.github.com/repos/pinterest/elixir-thrift/issues/478","number":478,"state":"open","locked":false,"title":"allow client to reconnect if other side closes connection","user":{"login":"cybernetlab","id":1825009,"node_id":"MDQ6VXNlcjE4MjUwMDk=","avatar_url":"https://avatars0.githubusercontent.com/u/1825009?v=4","gravatar_id":"","url":"https://api.github.com/users/cybernetlab","html_url":"https://github.com/cybernetlab","followers_url":"https://api.github.com/users/cybernetlab/followers","following_url":"https://api.github.com/users/cybernetlab/following{/other_user}","gists_url":"https://api.github.com/users/cybernetlab/gists{/gist_id}","starred_url":"https://api.github.com/users/cybernetlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cybernetlab/subscriptions","organizations_url":"https://api.github.com/users/cybernetlab/orgs","repos_url":"https://api.github.com/users/cybernetlab/repos","events_url":"https://api.github.com/users/cybernetlab/events{/privacy}","received_events_url":"https://api.github.com/users/cybernetlab/received_events","type":"User","site_admin":false},"body":"It would be nice to allow framed client to reconnect if other side closed connection because of client inactivity for example. In my personal case thrift library used as a client for `hbase` and this server closes inactive connections in about 10 minutes. Also I'm using `poolboy` to pool connections and without reconnection ability I'll need to do some unnecessary logic to monitor status of tcp connections and push out clients with closed connection from the pool.","created_at":"2019-09-16T17:36:00Z","updated_at":"2019-09-17T01:38:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d00f66bf8f29026279ef66f06cd187ae7223153f","assignee":{"login":"fishcakez","id":2001229,"node_id":"MDQ6VXNlcjIwMDEyMjk=","avatar_url":"https://avatars3.githubusercontent.com/u/2001229?v=4","gravatar_id":"","url":"https://api.github.com/users/fishcakez","html_url":"https://github.com/fishcakez","followers_url":"https://api.github.com/users/fishcakez/followers","following_url":"https://api.github.com/users/fishcakez/following{/other_user}","gists_url":"https://api.github.com/users/fishcakez/gists{/gist_id}","starred_url":"https://api.github.com/users/fishcakez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fishcakez/subscriptions","organizations_url":"https://api.github.com/users/fishcakez/orgs","repos_url":"https://api.github.com/users/fishcakez/repos","events_url":"https://api.github.com/users/fishcakez/events{/privacy}","received_events_url":"https://api.github.com/users/fishcakez/received_events","type":"User","site_admin":false},"assignees":[{"login":"fishcakez","id":2001229,"node_id":"MDQ6VXNlcjIwMDEyMjk=","avatar_url":"https://avatars3.githubusercontent.com/u/2001229?v=4","gravatar_id":"","url":"https://api.github.com/users/fishcakez","html_url":"https://github.com/fishcakez","followers_url":"https://api.github.com/users/fishcakez/followers","following_url":"https://api.github.com/users/fishcakez/following{/other_user}","gists_url":"https://api.github.com/users/fishcakez/gists{/gist_id}","starred_url":"https://api.github.com/users/fishcakez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fishcakez/subscriptions","organizations_url":"https://api.github.com/users/fishcakez/orgs","repos_url":"https://api.github.com/users/fishcakez/repos","events_url":"https://api.github.com/users/fishcakez/events{/privacy}","received_events_url":"https://api.github.com/users/fishcakez/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"jparise","id":10311,"node_id":"MDQ6VXNlcjEwMzEx","avatar_url":"https://avatars1.githubusercontent.com/u/10311?v=4","gravatar_id":"","url":"https://api.github.com/users/jparise","html_url":"https://github.com/jparise","followers_url":"https://api.github.com/users/jparise/followers","following_url":"https://api.github.com/users/jparise/following{/other_user}","gists_url":"https://api.github.com/users/jparise/gists{/gist_id}","starred_url":"https://api.github.com/users/jparise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jparise/subscriptions","organizations_url":"https://api.github.com/users/jparise/orgs","repos_url":"https://api.github.com/users/jparise/repos","events_url":"https://api.github.com/users/jparise/events{/privacy}","received_events_url":"https://api.github.com/users/jparise/received_events","type":"User","site_admin":false},{"login":"scohen","id":55809,"node_id":"MDQ6VXNlcjU1ODA5","avatar_url":"https://avatars3.githubusercontent.com/u/55809?v=4","gravatar_id":"","url":"https://api.github.com/users/scohen","html_url":"https://github.com/scohen","followers_url":"https://api.github.com/users/scohen/followers","following_url":"https://api.github.com/users/scohen/following{/other_user}","gists_url":"https://api.github.com/users/scohen/gists{/gist_id}","starred_url":"https://api.github.com/users/scohen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scohen/subscriptions","organizations_url":"https://api.github.com/users/scohen/orgs","repos_url":"https://api.github.com/users/scohen/repos","events_url":"https://api.github.com/users/scohen/events{/privacy}","received_events_url":"https://api.github.com/users/scohen/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":270572903,"node_id":"MDU6TGFiZWwyNzA1NzI5MDM=","url":"https://api.github.com/repos/pinterest/elixir-thrift/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/pinterest/elixir-thrift/pulls/478/commits","review_comments_url":"https://api.github.com/repos/pinterest/elixir-thrift/pulls/478/comments","review_comment_url":"https://api.github.com/repos/pinterest/elixir-thrift/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pinterest/elixir-thrift/issues/478/comments","statuses_url":"https://api.github.com/repos/pinterest/elixir-thrift/statuses/2a468b2a999c81f84c0271939a3a812d90b9c48a","head":{"label":"cybernetlab:allow-reconnect","ref":"allow-reconnect","sha":"2a468b2a999c81f84c0271939a3a812d90b9c48a","user":{"login":"cybernetlab","id":1825009,"node_id":"MDQ6VXNlcjE4MjUwMDk=","avatar_url":"https://avatars0.githubusercontent.com/u/1825009?v=4","gravatar_id":"","url":"https://api.github.com/users/cybernetlab","html_url":"https://github.com/cybernetlab","followers_url":"https://api.github.com/users/cybernetlab/followers","following_url":"https://api.github.com/users/cybernetlab/following{/other_user}","gists_url":"https://api.github.com/users/cybernetlab/gists{/gist_id}","starred_url":"https://api.github.com/users/cybernetlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cybernetlab/subscriptions","organizations_url":"https://api.github.com/users/cybernetlab/orgs","repos_url":"https://api.github.com/users/cybernetlab/repos","events_url":"https://api.github.com/users/cybernetlab/events{/privacy}","received_events_url":"https://api.github.com/users/cybernetlab/received_events","type":"User","site_admin":false},"repo":{"id":208851467,"node_id":"MDEwOlJlcG9zaXRvcnkyMDg4NTE0Njc=","name":"elixir-thrift","full_name":"cybernetlab/elixir-thrift","private":false,"owner":{"login":"cybernetlab","id":1825009,"node_id":"MDQ6VXNlcjE4MjUwMDk=","avatar_url":"https://avatars0.githubusercontent.com/u/1825009?v=4","gravatar_id":"","url":"https://api.github.com/users/cybernetlab","html_url":"https://github.com/cybernetlab","followers_url":"https://api.github.com/users/cybernetlab/followers","following_url":"https://api.github.com/users/cybernetlab/following{/other_user}","gists_url":"https://api.github.com/users/cybernetlab/gists{/gist_id}","starred_url":"https://api.github.com/users/cybernetlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cybernetlab/subscriptions","organizations_url":"https://api.github.com/users/cybernetlab/orgs","repos_url":"https://api.github.com/users/cybernetlab/repos","events_url":"https://api.github.com/users/cybernetlab/events{/privacy}","received_events_url":"https://api.github.com/users/cybernetlab/received_events","type":"User","site_admin":false},"html_url":"https://github.com/cybernetlab/elixir-thrift","description":"A Pure Elixir Thrift Implementation","fork":true,"url":"https://api.github.com/repos/cybernetlab/elixir-thrift","forks_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/forks","keys_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/teams","hooks_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/hooks","issue_events_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/issues/events{/number}","events_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/events","assignees_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/assignees{/user}","branches_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/branches{/branch}","tags_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/tags","blobs_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/git/refs{/sha}","trees_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/statuses/{sha}","languages_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/languages","stargazers_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/stargazers","contributors_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/contributors","subscribers_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/subscribers","subscription_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/subscription","commits_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/commits{/sha}","git_commits_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/git/commits{/sha}","comments_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/comments{/number}","issue_comment_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/issues/comments{/number}","contents_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/contents/{+path}","compare_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/merges","archive_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/downloads","issues_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/issues{/number}","pulls_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/pulls{/number}","milestones_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/milestones{/number}","notifications_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/labels{/name}","releases_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/releases{/id}","deployments_url":"https://api.github.com/repos/cybernetlab/elixir-thrift/deployments","created_at":"2019-09-16T16:52:25Z","updated_at":"2019-09-16T17:17:17Z","pushed_at":"2019-09-16T19:38:37Z","git_url":"git://github.com/cybernetlab/elixir-thrift.git","ssh_url":"git@github.com:cybernetlab/elixir-thrift.git","clone_url":"https://github.com/cybernetlab/elixir-thrift.git","svn_url":"https://github.com/cybernetlab/elixir-thrift","homepage":"https://hexdocs.pm/thrift/","size":908,"stargazers_count":0,"watchers_count":0,"language":"Elixir","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pinterest:master","ref":"master","sha":"465fb2ddbf4d356b4cb21dce3bdc02407f951d37","user":{"login":"pinterest","id":541152,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU0MTE1Mg==","avatar_url":"https://avatars2.githubusercontent.com/u/541152?v=4","gravatar_id":"","url":"https://api.github.com/users/pinterest","html_url":"https://github.com/pinterest","followers_url":"https://api.github.com/users/pinterest/followers","following_url":"https://api.github.com/users/pinterest/following{/other_user}","gists_url":"https://api.github.com/users/pinterest/gists{/gist_id}","starred_url":"https://api.github.com/users/pinterest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pinterest/subscriptions","organizations_url":"https://api.github.com/users/pinterest/orgs","repos_url":"https://api.github.com/users/pinterest/repos","events_url":"https://api.github.com/users/pinterest/events{/privacy}","received_events_url":"https://api.github.com/users/pinterest/received_events","type":"Organization","site_admin":false},"repo":{"id":43914111,"node_id":"MDEwOlJlcG9zaXRvcnk0MzkxNDExMQ==","name":"elixir-thrift","full_name":"pinterest/elixir-thrift","private":false,"owner":{"login":"pinterest","id":541152,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU0MTE1Mg==","avatar_url":"https://avatars2.githubusercontent.com/u/541152?v=4","gravatar_id":"","url":"https://api.github.com/users/pinterest","html_url":"https://github.com/pinterest","followers_url":"https://api.github.com/users/pinterest/followers","following_url":"https://api.github.com/users/pinterest/following{/other_user}","gists_url":"https://api.github.com/users/pinterest/gists{/gist_id}","starred_url":"https://api.github.com/users/pinterest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pinterest/subscriptions","organizations_url":"https://api.github.com/users/pinterest/orgs","repos_url":"https://api.github.com/users/pinterest/repos","events_url":"https://api.github.com/users/pinterest/events{/privacy}","received_events_url":"https://api.github.com/users/pinterest/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/pinterest/elixir-thrift","description":"A Pure Elixir Thrift Implementation","fork":false,"url":"https://api.github.com/repos/pinterest/elixir-thrift","forks_url":"https://api.github.com/repos/pinterest/elixir-thrift/forks","keys_url":"https://api.github.com/repos/pinterest/elixir-thrift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pinterest/elixir-thrift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pinterest/elixir-thrift/teams","hooks_url":"https://api.github.com/repos/pinterest/elixir-thrift/hooks","issue_events_url":"https://api.github.com/repos/pinterest/elixir-thrift/issues/events{/number}","events_url":"https://api.github.com/repos/pinterest/elixir-thrift/events","assignees_url":"https://api.github.com/repos/pinterest/elixir-thrift/assignees{/user}","branches_url":"https://api.github.com/repos/pinterest/elixir-thrift/branches{/branch}","tags_url":"https://api.github.com/repos/pinterest/elixir-thrift/tags","blobs_url":"https://api.github.com/repos/pinterest/elixir-thrift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pinterest/elixir-thrift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pinterest/elixir-thrift/git/refs{/sha}","trees_url":"https://api.github.com/repos/pinterest/elixir-thrift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pinterest/elixir-thrift/statuses/{sha}","languages_url":"https://api.github.com/repos/pinterest/elixir-thrift/languages","stargazers_url":"https://api.github.com/repos/pinterest/elixir-thrift/stargazers","contributors_url":"https://api.github.com/repos/pinterest/elixir-thrift/contributors","subscribers_url":"https://api.github.com/repos/pinterest/elixir-thrift/subscribers","subscription_url":"https://api.github.com/repos/pinterest/elixir-thrift/subscription","commits_url":"https://api.github.com/repos/pinterest/elixir-thrift/commits{/sha}","git_commits_url":"https://api.github.com/repos/pinterest/elixir-thrift/git/commits{/sha}","comments_url":"https://api.github.com/repos/pinterest/elixir-thrift/comments{/number}","issue_comment_url":"https://api.github.com/repos/pinterest/elixir-thrift/issues/comments{/number}","contents_url":"https://api.github.com/repos/pinterest/elixir-thrift/contents/{+path}","compare_url":"https://api.github.com/repos/pinterest/elixir-thrift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pinterest/elixir-thrift/merges","archive_url":"https://api.github.com/repos/pinterest/elixir-thrift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pinterest/elixir-thrift/downloads","issues_url":"https://api.github.com/repos/pinterest/elixir-thrift/issues{/number}","pulls_url":"https://api.github.com/repos/pinterest/elixir-thrift/pulls{/number}","milestones_url":"https://api.github.com/repos/pinterest/elixir-thrift/milestones{/number}","notifications_url":"https://api.github.com/repos/pinterest/elixir-thrift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pinterest/elixir-thrift/labels{/name}","releases_url":"https://api.github.com/repos/pinterest/elixir-thrift/releases{/id}","deployments_url":"https://api.github.com/repos/pinterest/elixir-thrift/deployments","created_at":"2015-10-08T20:17:30Z","updated_at":"2019-09-12T21:05:28Z","pushed_at":"2019-09-16T19:38:39Z","git_url":"git://github.com/pinterest/elixir-thrift.git","ssh_url":"git@github.com:pinterest/elixir-thrift.git","clone_url":"https://github.com/pinterest/elixir-thrift.git","svn_url":"https://github.com/pinterest/elixir-thrift","homepage":"https://hexdocs.pm/thrift/","size":905,"stargazers_count":144,"watchers_count":144,"language":"Elixir","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":30,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":26,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":30,"open_issues":26,"watchers":144,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pinterest/elixir-thrift/pulls/478"},"html":{"href":"https://github.com/pinterest/elixir-thrift/pull/478"},"issue":{"href":"https://api.github.com/repos/pinterest/elixir-thrift/issues/478"},"comments":{"href":"https://api.github.com/repos/pinterest/elixir-thrift/issues/478/comments"},"review_comments":{"href":"https://api.github.com/repos/pinterest/elixir-thrift/pulls/478/comments"},"review_comment":{"href":"https://api.github.com/repos/pinterest/elixir-thrift/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pinterest/elixir-thrift/pulls/478/commits"},"statuses":{"href":"https://api.github.com/repos/pinterest/elixir-thrift/statuses/2a468b2a999c81f84c0271939a3a812d90b9c48a"}},"author_association":"NONE"}}
other: {"actor":{"display_login":"fishcakez"}}