{"action":"created","comment":{"url":"https://api.github.com/repos/apache/flink/pulls/comments/37598999","id":37598999,"diff_hunk":"@@ -73,13 +84,44 @@ public void intializeConnection() {\n \t *\t\t\tThe incoming data\n \t */\n \t@Override\n-\tpublic void invoke(IN value) {\n+\tpublic void invoke(IN value) throws Exception {\n \t\tbyte[] msg = schema.serialize(value);\n \t\ttry {\n \t\t\tdataOutputStream.write(msg);\n \t\t} catch (IOException e) {\n-\t\t\tthrow new RuntimeException(\"Cannot send message \" + value.toString() +\n-\t\t\t\t\t\" to socket server at \" + hostName + \":\" + port, e);\n+\t\t\tretries = 0;\n+\t\t\tboolean success = false;\n+\t\t\twhile ((retries < maxRetry || retryForever) && !success && isRunning){\n+\t\t\t\ttry {\n+\n+\t\t\t\t\tif (dataOutputStream != null) {\n+\t\t\t\t\t\tdataOutputStream.close();\n+\t\t\t\t\t}\n+\n+\t\t\t\t\tif (client != null && !client.isClosed()) {\n+\t\t\t\t\t\tclient.close();\n+\t\t\t\t\t}\n+\n+\t\t\t\t\tif (!retryForever){\n+\t\t\t\t\t\tretries++;\n+\t\t\t\t\t}\n+\n+\t\t\t\t\tclient = new Socket(hostName, port);\n+\t\t\t\t\tdataOutputStream = new DataOutputStream(client.getOutputStream());\n+\t\t\t\t\tdataOutputStream.write(msg);\n+\t\t\t\t\tsuccess = true;\n+\n+\t\t\t\t}catch(Exception ee){","path":"flink-staging/flink-streaming/flink-streaming-core/src/main/java/org/apache/flink/streaming/api/functions/sink/SocketClientSink.java","position":71,"original_position":71,"commit_id":"61463effff8ca59036a8ae3c03a631e111e600ab","original_commit_id":"61463effff8ca59036a8ae3c03a631e111e600ab","user":{"login":"HuangWHWHW","id":13193847,"avatar_url":"https://avatars.githubusercontent.com/u/13193847?v=3","gravatar_id":"","url":"https://api.github.com/users/HuangWHWHW","html_url":"https://github.com/HuangWHWHW","followers_url":"https://api.github.com/users/HuangWHWHW/followers","following_url":"https://api.github.com/users/HuangWHWHW/following{/other_user}","gists_url":"https://api.github.com/users/HuangWHWHW/gists{/gist_id}","starred_url":"https://api.github.com/users/HuangWHWHW/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HuangWHWHW/subscriptions","organizations_url":"https://api.github.com/users/HuangWHWHW/orgs","repos_url":"https://api.github.com/users/HuangWHWHW/repos","events_url":"https://api.github.com/users/HuangWHWHW/events{/privacy}","received_events_url":"https://api.github.com/users/HuangWHWHW/received_events","type":"User","site_admin":false},"body":"Yes, it depends on you.","created_at":"2015-08-21T01:23:08Z","updated_at":"2015-08-21T01:23:08Z","html_url":"https://github.com/apache/flink/pull/1030#discussion_r37598999","pull_request_url":"https://api.github.com/repos/apache/flink/pulls/1030","_links":{"self":{"href":"https://api.github.com/repos/apache/flink/pulls/comments/37598999"},"html":{"href":"https://github.com/apache/flink/pull/1030#discussion_r37598999"},"pull_request":{"href":"https://api.github.com/repos/apache/flink/pulls/1030"}}},"pull_request":{"url":"https://api.github.com/repos/apache/flink/pulls/1030","id":42569431,"html_url":"https://github.com/apache/flink/pull/1030","diff_url":"https://github.com/apache/flink/pull/1030.diff","patch_url":"https://github.com/apache/flink/pull/1030.patch","issue_url":"https://api.github.com/repos/apache/flink/issues/1030","number":1030,"state":"open","locked":false,"title":"[FLINK-2536][streaming]add a re-connect for socket sink","user":{"login":"HuangWHWHW","id":13193847,"avatar_url":"https://avatars.githubusercontent.com/u/13193847?v=3","gravatar_id":"","url":"https://api.github.com/users/HuangWHWHW","html_url":"https://github.com/HuangWHWHW","followers_url":"https://api.github.com/users/HuangWHWHW/followers","following_url":"https://api.github.com/users/HuangWHWHW/following{/other_user}","gists_url":"https://api.github.com/users/HuangWHWHW/gists{/gist_id}","starred_url":"https://api.github.com/users/HuangWHWHW/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HuangWHWHW/subscriptions","organizations_url":"https://api.github.com/users/HuangWHWHW/orgs","repos_url":"https://api.github.com/users/HuangWHWHW/repos","events_url":"https://api.github.com/users/HuangWHWHW/events{/privacy}","received_events_url":"https://api.github.com/users/HuangWHWHW/received_events","type":"User","site_admin":false},"body":"add a re-connect in function invoke() when it throws exception.","created_at":"2015-08-17T09:33:59Z","updated_at":"2015-08-21T01:23:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7057cd8cd8892ae3b93166aca2cbe01c6cae293b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/flink/pulls/1030/commits","review_comments_url":"https://api.github.com/repos/apache/flink/pulls/1030/comments","review_comment_url":"https://api.github.com/repos/apache/flink/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/flink/issues/1030/comments","statuses_url":"https://api.github.com/repos/apache/flink/statuses/61463effff8ca59036a8ae3c03a631e111e600ab","head":{"label":"HuangWHWHW:FLINK-2536","ref":"FLINK-2536","sha":"61463effff8ca59036a8ae3c03a631e111e600ab","user":{"login":"HuangWHWHW","id":13193847,"avatar_url":"https://avatars.githubusercontent.com/u/13193847?v=3","gravatar_id":"","url":"https://api.github.com/users/HuangWHWHW","html_url":"https://github.com/HuangWHWHW","followers_url":"https://api.github.com/users/HuangWHWHW/followers","following_url":"https://api.github.com/users/HuangWHWHW/following{/other_user}","gists_url":"https://api.github.com/users/HuangWHWHW/gists{/gist_id}","starred_url":"https://api.github.com/users/HuangWHWHW/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HuangWHWHW/subscriptions","organizations_url":"https://api.github.com/users/HuangWHWHW/orgs","repos_url":"https://api.github.com/users/HuangWHWHW/repos","events_url":"https://api.github.com/users/HuangWHWHW/events{/privacy}","received_events_url":"https://api.github.com/users/HuangWHWHW/received_events","type":"User","site_admin":false},"repo":{"id":38603893,"name":"flink","full_name":"HuangWHWHW/flink","owner":{"login":"HuangWHWHW","id":13193847,"avatar_url":"https://avatars.githubusercontent.com/u/13193847?v=3","gravatar_id":"","url":"https://api.github.com/users/HuangWHWHW","html_url":"https://github.com/HuangWHWHW","followers_url":"https://api.github.com/users/HuangWHWHW/followers","following_url":"https://api.github.com/users/HuangWHWHW/following{/other_user}","gists_url":"https://api.github.com/users/HuangWHWHW/gists{/gist_id}","starred_url":"https://api.github.com/users/HuangWHWHW/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HuangWHWHW/subscriptions","organizations_url":"https://api.github.com/users/HuangWHWHW/orgs","repos_url":"https://api.github.com/users/HuangWHWHW/repos","events_url":"https://api.github.com/users/HuangWHWHW/events{/privacy}","received_events_url":"https://api.github.com/users/HuangWHWHW/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/HuangWHWHW/flink","description":"Mirror of Apache Flink","fork":true,"url":"https://api.github.com/repos/HuangWHWHW/flink","forks_url":"https://api.github.com/repos/HuangWHWHW/flink/forks","keys_url":"https://api.github.com/repos/HuangWHWHW/flink/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HuangWHWHW/flink/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HuangWHWHW/flink/teams","hooks_url":"https://api.github.com/repos/HuangWHWHW/flink/hooks","issue_events_url":"https://api.github.com/repos/HuangWHWHW/flink/issues/events{/number}","events_url":"https://api.github.com/repos/HuangWHWHW/flink/events","assignees_url":"https://api.github.com/repos/HuangWHWHW/flink/assignees{/user}","branches_url":"https://api.github.com/repos/HuangWHWHW/flink/branches{/branch}","tags_url":"https://api.github.com/repos/HuangWHWHW/flink/tags","blobs_url":"https://api.github.com/repos/HuangWHWHW/flink/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HuangWHWHW/flink/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HuangWHWHW/flink/git/refs{/sha}","trees_url":"https://api.github.com/repos/HuangWHWHW/flink/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HuangWHWHW/flink/statuses/{sha}","languages_url":"https://api.github.com/repos/HuangWHWHW/flink/languages","stargazers_url":"https://api.github.com/repos/HuangWHWHW/flink/stargazers","contributors_url":"https://api.github.com/repos/HuangWHWHW/flink/contributors","subscribers_url":"https://api.github.com/repos/HuangWHWHW/flink/subscribers","subscription_url":"https://api.github.com/repos/HuangWHWHW/flink/subscription","commits_url":"https://api.github.com/repos/HuangWHWHW/flink/commits{/sha}","git_commits_url":"https://api.github.com/repos/HuangWHWHW/flink/git/commits{/sha}","comments_url":"https://api.github.com/repos/HuangWHWHW/flink/comments{/number}","issue_comment_url":"https://api.github.com/repos/HuangWHWHW/flink/issues/comments{/number}","contents_url":"https://api.github.com/repos/HuangWHWHW/flink/contents/{+path}","compare_url":"https://api.github.com/repos/HuangWHWHW/flink/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HuangWHWHW/flink/merges","archive_url":"https://api.github.com/repos/HuangWHWHW/flink/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HuangWHWHW/flink/downloads","issues_url":"https://api.github.com/repos/HuangWHWHW/flink/issues{/number}","pulls_url":"https://api.github.com/repos/HuangWHWHW/flink/pulls{/number}","milestones_url":"https://api.github.com/repos/HuangWHWHW/flink/milestones{/number}","notifications_url":"https://api.github.com/repos/HuangWHWHW/flink/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HuangWHWHW/flink/labels{/name}","releases_url":"https://api.github.com/repos/HuangWHWHW/flink/releases{/id}","created_at":"2015-07-06T07:25:09Z","updated_at":"2015-07-06T07:25:20Z","pushed_at":"2015-08-19T09:30:12Z","git_url":"git://github.com/HuangWHWHW/flink.git","ssh_url":"git@github.com:HuangWHWHW/flink.git","clone_url":"https://github.com/HuangWHWHW/flink.git","svn_url":"https://github.com/HuangWHWHW/flink","homepage":null,"size":56610,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"8602b7af0d048139ba90f36162e590da1050891d","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":20587599,"name":"flink","full_name":"apache/flink","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/flink","description":"Mirror of Apache Flink","fork":false,"url":"https://api.github.com/repos/apache/flink","forks_url":"https://api.github.com/repos/apache/flink/forks","keys_url":"https://api.github.com/repos/apache/flink/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/flink/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/flink/teams","hooks_url":"https://api.github.com/repos/apache/flink/hooks","issue_events_url":"https://api.github.com/repos/apache/flink/issues/events{/number}","events_url":"https://api.github.com/repos/apache/flink/events","assignees_url":"https://api.github.com/repos/apache/flink/assignees{/user}","branches_url":"https://api.github.com/repos/apache/flink/branches{/branch}","tags_url":"https://api.github.com/repos/apache/flink/tags","blobs_url":"https://api.github.com/repos/apache/flink/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/flink/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/flink/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/flink/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/flink/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/flink/languages","stargazers_url":"https://api.github.com/repos/apache/flink/stargazers","contributors_url":"https://api.github.com/repos/apache/flink/contributors","subscribers_url":"https://api.github.com/repos/apache/flink/subscribers","subscription_url":"https://api.github.com/repos/apache/flink/subscription","commits_url":"https://api.github.com/repos/apache/flink/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/flink/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/flink/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/flink/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/flink/contents/{+path}","compare_url":"https://api.github.com/repos/apache/flink/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/flink/merges","archive_url":"https://api.github.com/repos/apache/flink/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/flink/downloads","issues_url":"https://api.github.com/repos/apache/flink/issues{/number}","pulls_url":"https://api.github.com/repos/apache/flink/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/flink/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/flink/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/flink/labels{/name}","releases_url":"https://api.github.com/repos/apache/flink/releases{/id}","created_at":"2014-06-07T07:00:10Z","updated_at":"2015-08-20T18:52:22Z","pushed_at":"2015-08-20T15:46:02Z","git_url":"git://github.com/apache/flink.git","ssh_url":"git@github.com:apache/flink.git","clone_url":"https://github.com/apache/flink.git","svn_url":"https://github.com/apache/flink","homepage":null,"size":2500449,"stargazers_count":570,"watchers_count":570,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":374,"mirror_url":"git://git.apache.org/incubator-flink.git","open_issues_count":72,"forks":374,"open_issues":72,"watchers":570,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/flink/pulls/1030"},"html":{"href":"https://github.com/apache/flink/pull/1030"},"issue":{"href":"https://api.github.com/repos/apache/flink/issues/1030"},"comments":{"href":"https://api.github.com/repos/apache/flink/issues/1030/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/flink/pulls/1030/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/flink/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/flink/pulls/1030/commits"},"statuses":{"href":"https://api.github.com/repos/apache/flink/statuses/61463effff8ca59036a8ae3c03a631e111e600ab"}}}}