{"action":"created","comment":{"url":"https://api.github.com/repos/apache/flink/pulls/comments/40058785","id":40058785,"diff_hunk":"@@ -189,9 +191,17 @@ public static InetAddress findConnectingAddress(InetSocketAddress targetAddress,\n \t\tlong currentSleepTime = MIN_SLEEP_TIME;\n \t\tlong elapsedTime = 0;\n \n+\t\t// before trying with different strategies: test with getLocalHost():\n+\t\tInetAddress localhostName = InetAddress.getLocalHost();\n+\n+\t\tif(tryToConnect(localhostName, targetAddress, AddressDetectionState.ADDRESS.getTimeout(), false)) {\n+\t\t\tLOG.debug(\"Using immediately InetAddress.getLocalHost() for the connecting address\");","path":"flink-runtime/src/main/java/org/apache/flink/runtime/net/NetUtils.java","position":17,"original_position":17,"commit_id":"f9913e731f44c0c84e83670dfe35d2c4ead09a4a","original_commit_id":"f9913e731f44c0c84e83670dfe35d2c4ead09a4a","user":{"login":"rmetzger","id":89049,"avatar_url":"https://avatars.githubusercontent.com/u/89049?v=3","gravatar_id":"","url":"https://api.github.com/users/rmetzger","html_url":"https://github.com/rmetzger","followers_url":"https://api.github.com/users/rmetzger/followers","following_url":"https://api.github.com/users/rmetzger/following{/other_user}","gists_url":"https://api.github.com/users/rmetzger/gists{/gist_id}","starred_url":"https://api.github.com/users/rmetzger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmetzger/subscriptions","organizations_url":"https://api.github.com/users/rmetzger/orgs","repos_url":"https://api.github.com/users/rmetzger/repos","events_url":"https://api.github.com/users/rmetzger/events{/privacy}","received_events_url":"https://api.github.com/users/rmetzger/received_events","type":"User","site_admin":false},"body":"These are the produced log statements in `DEBUG` level:\r\n```\r\n16:12:19,822 INFO  org.apache.flink.runtime.util.LeaderRetrievalUtils            - Trying to select the network interface and address to use by connecting to the leading JobManager.\r\n16:12:19,822 INFO  org.apache.flink.runtime.util.LeaderRetrievalUtils            - TaskManager will try to connect for 10000 milliseconds before falling back to heuristics\r\n16:12:19,833 INFO  org.apache.flink.runtime.net.NetUtils                         - Retrieved new target address /10.240.221.7:33378.\r\n16:12:19,835 DEBUG org.apache.flink.runtime.net.NetUtils                         - Trying to connect to (/10.240.221.7:33378) from local address cdh544-master.c.astral-sorter-757.internal/10.240.242.143 with timeout 50\r\n16:12:19,838 DEBUG org.apache.flink.runtime.net.NetUtils                         - Using immediately InetAddress.getLocalHost() for the connecting address\r\n16:12:19,839 INFO  org.apache.flink.runtime.taskmanager.TaskManager              - TaskManager will use hostname/address 'cdh544-master.c.astral-sorter-757.internal' (10.240.242.143) for communication.\r\n16:12:19,839 INFO  org.apache.flink.runtime.taskmanager.TaskManager              - Starting TaskManager in streaming mode BATCH_ONLY\r\n16:12:19,839 INFO  org.apache.flink.runtime.taskmanager.TaskManager              - Starting TaskManager actor system at cdh544-master.c.astral-sorter-757.internal:0\r\n```\r\nI think the messages in `INFO` level contain enough information for users to understand whats going on.","created_at":"2015-09-22T07:28:51Z","updated_at":"2015-09-22T07:28:51Z","html_url":"https://github.com/apache/flink/pull/1159#discussion_r40058785","pull_request_url":"https://api.github.com/repos/apache/flink/pulls/1159","_links":{"self":{"href":"https://api.github.com/repos/apache/flink/pulls/comments/40058785"},"html":{"href":"https://github.com/apache/flink/pull/1159#discussion_r40058785"},"pull_request":{"href":"https://api.github.com/repos/apache/flink/pulls/1159"}}},"pull_request":{"url":"https://api.github.com/repos/apache/flink/pulls/1159","id":45569133,"html_url":"https://github.com/apache/flink/pull/1159","diff_url":"https://github.com/apache/flink/pull/1159.diff","patch_url":"https://github.com/apache/flink/pull/1159.patch","issue_url":"https://api.github.com/repos/apache/flink/issues/1159","number":1159,"state":"open","locked":false,"title":"[FLINK-2722] Use InetAddress.getLocalHost() as first approach when detecting the TMs own ip/hostname","user":{"login":"rmetzger","id":89049,"avatar_url":"https://avatars.githubusercontent.com/u/89049?v=3","gravatar_id":"","url":"https://api.github.com/users/rmetzger","html_url":"https://github.com/rmetzger","followers_url":"https://api.github.com/users/rmetzger/followers","following_url":"https://api.github.com/users/rmetzger/following{/other_user}","gists_url":"https://api.github.com/users/rmetzger/gists{/gist_id}","starred_url":"https://api.github.com/users/rmetzger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmetzger/subscriptions","organizations_url":"https://api.github.com/users/rmetzger/orgs","repos_url":"https://api.github.com/users/rmetzger/repos","events_url":"https://api.github.com/users/rmetzger/events{/privacy}","received_events_url":"https://api.github.com/users/rmetzger/received_events","type":"User","site_admin":false},"body":"A user reported a connection issue with Netty being unable to connect to a TaskManager to subscribe to an intermediate result.\r\nThe problem occurred when the TaskManager and JobManager were running on the same host (something that can easily happen on YARN).\r\nIn that case, the TaskManager was reporting a host-local ip address to the JobManager when connecting.\r\n\r\nTo avoid the issue in the future, the TaskManager first tries to use the hostname returned by InetAddress.getLocalHost(). In a properly set-up environment, this will return a connection which is accessible by all machines in a cluster.\r\n\r\nI tested this implementation on a cluster in GCE using YARN (note that I was not able to reproduce the issue originally reported, but the user reported that the issue has been fixed)\r\n\r\nI would really like to include this fix into the **0.10-milestone-1** release!","created_at":"2015-09-21T16:21:55Z","updated_at":"2015-09-22T07:28:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"425b693a160193ab1096d7cfd03ce23b99d2825c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/flink/pulls/1159/commits","review_comments_url":"https://api.github.com/repos/apache/flink/pulls/1159/comments","review_comment_url":"https://api.github.com/repos/apache/flink/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/flink/issues/1159/comments","statuses_url":"https://api.github.com/repos/apache/flink/statuses/f9913e731f44c0c84e83670dfe35d2c4ead09a4a","head":{"label":"rmetzger:network_detection_0.10","ref":"network_detection_0.10","sha":"f9913e731f44c0c84e83670dfe35d2c4ead09a4a","user":{"login":"rmetzger","id":89049,"avatar_url":"https://avatars.githubusercontent.com/u/89049?v=3","gravatar_id":"","url":"https://api.github.com/users/rmetzger","html_url":"https://github.com/rmetzger","followers_url":"https://api.github.com/users/rmetzger/followers","following_url":"https://api.github.com/users/rmetzger/following{/other_user}","gists_url":"https://api.github.com/users/rmetzger/gists{/gist_id}","starred_url":"https://api.github.com/users/rmetzger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmetzger/subscriptions","organizations_url":"https://api.github.com/users/rmetzger/orgs","repos_url":"https://api.github.com/users/rmetzger/repos","events_url":"https://api.github.com/users/rmetzger/events{/privacy}","received_events_url":"https://api.github.com/users/rmetzger/received_events","type":"User","site_admin":false},"repo":{"id":20618957,"name":"flink","full_name":"rmetzger/flink","owner":{"login":"rmetzger","id":89049,"avatar_url":"https://avatars.githubusercontent.com/u/89049?v=3","gravatar_id":"","url":"https://api.github.com/users/rmetzger","html_url":"https://github.com/rmetzger","followers_url":"https://api.github.com/users/rmetzger/followers","following_url":"https://api.github.com/users/rmetzger/following{/other_user}","gists_url":"https://api.github.com/users/rmetzger/gists{/gist_id}","starred_url":"https://api.github.com/users/rmetzger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmetzger/subscriptions","organizations_url":"https://api.github.com/users/rmetzger/orgs","repos_url":"https://api.github.com/users/rmetzger/repos","events_url":"https://api.github.com/users/rmetzger/events{/privacy}","received_events_url":"https://api.github.com/users/rmetzger/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rmetzger/flink","description":"Mirror of Apache Flink","fork":true,"url":"https://api.github.com/repos/rmetzger/flink","forks_url":"https://api.github.com/repos/rmetzger/flink/forks","keys_url":"https://api.github.com/repos/rmetzger/flink/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rmetzger/flink/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rmetzger/flink/teams","hooks_url":"https://api.github.com/repos/rmetzger/flink/hooks","issue_events_url":"https://api.github.com/repos/rmetzger/flink/issues/events{/number}","events_url":"https://api.github.com/repos/rmetzger/flink/events","assignees_url":"https://api.github.com/repos/rmetzger/flink/assignees{/user}","branches_url":"https://api.github.com/repos/rmetzger/flink/branches{/branch}","tags_url":"https://api.github.com/repos/rmetzger/flink/tags","blobs_url":"https://api.github.com/repos/rmetzger/flink/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rmetzger/flink/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rmetzger/flink/git/refs{/sha}","trees_url":"https://api.github.com/repos/rmetzger/flink/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rmetzger/flink/statuses/{sha}","languages_url":"https://api.github.com/repos/rmetzger/flink/languages","stargazers_url":"https://api.github.com/repos/rmetzger/flink/stargazers","contributors_url":"https://api.github.com/repos/rmetzger/flink/contributors","subscribers_url":"https://api.github.com/repos/rmetzger/flink/subscribers","subscription_url":"https://api.github.com/repos/rmetzger/flink/subscription","commits_url":"https://api.github.com/repos/rmetzger/flink/commits{/sha}","git_commits_url":"https://api.github.com/repos/rmetzger/flink/git/commits{/sha}","comments_url":"https://api.github.com/repos/rmetzger/flink/comments{/number}","issue_comment_url":"https://api.github.com/repos/rmetzger/flink/issues/comments{/number}","contents_url":"https://api.github.com/repos/rmetzger/flink/contents/{+path}","compare_url":"https://api.github.com/repos/rmetzger/flink/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rmetzger/flink/merges","archive_url":"https://api.github.com/repos/rmetzger/flink/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rmetzger/flink/downloads","issues_url":"https://api.github.com/repos/rmetzger/flink/issues{/number}","pulls_url":"https://api.github.com/repos/rmetzger/flink/pulls{/number}","milestones_url":"https://api.github.com/repos/rmetzger/flink/milestones{/number}","notifications_url":"https://api.github.com/repos/rmetzger/flink/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rmetzger/flink/labels{/name}","releases_url":"https://api.github.com/repos/rmetzger/flink/releases{/id}","created_at":"2014-06-08T14:58:57Z","updated_at":"2015-04-21T08:05:13Z","pushed_at":"2015-09-21T16:40:45Z","git_url":"git://github.com/rmetzger/flink.git","ssh_url":"git@github.com:rmetzger/flink.git","clone_url":"https://github.com/rmetzger/flink.git","svn_url":"https://github.com/rmetzger/flink","homepage":null,"size":66837,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"b9663c40754f522648f33dd7f56f2a47232c3836","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-09-21T10:09:11Z","pushed_at":"2015-09-22T07:21:23Z","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":2524074,"stargazers_count":626,"watchers_count":626,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":421,"mirror_url":"git://git.apache.org/incubator-flink.git","open_issues_count":72,"forks":421,"open_issues":72,"watchers":626,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/flink/pulls/1159"},"html":{"href":"https://github.com/apache/flink/pull/1159"},"issue":{"href":"https://api.github.com/repos/apache/flink/issues/1159"},"comments":{"href":"https://api.github.com/repos/apache/flink/issues/1159/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/flink/pulls/1159/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/flink/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/flink/pulls/1159/commits"},"statuses":{"href":"https://api.github.com/repos/apache/flink/statuses/f9913e731f44c0c84e83670dfe35d2c4ead09a4a"}}}}