{"action":"created","comment":{"url":"https://api.github.com/repos/zettio/weave/pulls/comments/24979131","id":24979131,"diff_hunk":"@@ -112,6 +116,76 @@ func TestDNSServer(t *testing.T) {\n \t// needs two servers, each listening on its own address\n }\n \n+func TestTCPDNSServer(t *testing.T) {\n+\tconst (\n+\t\tport          = 17625\n+\t\tlocalTestName = \"test1.weave.local.\"\n+\t\ttestAddr1     = \"10.0.2.1\"\n+\t)\n+\tdnsAddr := fmt.Sprintf(\"localhost:%d\", port)\n+\n+\tInitDefaultLogging(true)\n+\tvar zone = new(ZoneDb)\n+\n+\t// Insert a bunch of IPs for the same name\n+\tansCount := 0\n+\tfor i := 0; i < 255; i++ {\n+\t\tfor j := 0; j < 10; j++ {\n+\t\t\tip := net.ParseIP(fmt.Sprintf(\"10.0.%d.%d\", i, j))\n+\t\t\tansCount += 1\n+\t\t\terr := zone.AddRecord(containerID, localTestName, ip)\n+\t\t\twt.AssertNoErr(t, err)\n+\t\t}\n+\t}\n+\n+\t// Run another DNS server for fallback\n+\ts, fallbackAddr, err := RunLocalUDPServer(\"127.0.0.1:0\")\n+\twt.AssertNoErr(t, err)\n+\tdefer s.Shutdown()\n+\n+\t_, fallbackPort, err := net.SplitHostPort(fallbackAddr)\n+\twt.AssertNoErr(t, err)\n+\n+\tconfig := &dns.ClientConfig{Servers: []string{\"127.0.0.1\"}, Port: fallbackPort}\n+\tsrv, err := NewDNSServerWithConfig(config, zone, nil, port)\n+\twt.AssertNoErr(t, err)\n+\tdefer srv.Stop()\n+\tgo srv.Start()","path":"nameserver/server_test.go","position":85,"original_position":85,"commit_id":"2838bf040a151276bfea906f10e1ffff32ac8bac","original_commit_id":"2838bf040a151276bfea906f10e1ffff32ac8bac","user":{"login":"rade","id":109109,"avatar_url":"https://avatars.githubusercontent.com/u/109109?v=3","gravatar_id":"","url":"https://api.github.com/users/rade","html_url":"https://github.com/rade","followers_url":"https://api.github.com/users/rade/followers","following_url":"https://api.github.com/users/rade/following{/other_user}","gists_url":"https://api.github.com/users/rade/gists{/gist_id}","starred_url":"https://api.github.com/users/rade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rade/subscriptions","organizations_url":"https://api.github.com/users/rade/orgs","repos_url":"https://api.github.com/users/rade/repos","events_url":"https://api.github.com/users/rade/events{/privacy}","received_events_url":"https://api.github.com/users/rade/received_events","type":"User","site_admin":false},"body":"I don't understand why this is a goroutine. `Start` does itself spawn goroutines, and, afaict, does terminate.","created_at":"2015-02-19T10:47:12Z","updated_at":"2015-02-19T10:47:12Z","html_url":"https://github.com/zettio/weave/pull/392#discussion_r24979131","pull_request_url":"https://api.github.com/repos/zettio/weave/pulls/392","_links":{"self":{"href":"https://api.github.com/repos/zettio/weave/pulls/comments/24979131"},"html":{"href":"https://github.com/zettio/weave/pull/392#discussion_r24979131"},"pull_request":{"href":"https://api.github.com/repos/zettio/weave/pulls/392"}}},"pull_request":{"url":"https://api.github.com/repos/zettio/weave/pulls/392","id":29087452,"html_url":"https://github.com/zettio/weave/pull/392","diff_url":"https://github.com/zettio/weave/pull/392.diff","patch_url":"https://github.com/zettio/weave/pull/392.patch","issue_url":"https://api.github.com/repos/zettio/weave/issues/392","number":392,"state":"open","locked":false,"title":"weave-362: support TCP fall-back for very large DNS responses","user":{"login":"inercia","id":1841612,"avatar_url":"https://avatars.githubusercontent.com/u/1841612?v=3","gravatar_id":"","url":"https://api.github.com/users/inercia","html_url":"https://github.com/inercia","followers_url":"https://api.github.com/users/inercia/followers","following_url":"https://api.github.com/users/inercia/following{/other_user}","gists_url":"https://api.github.com/users/inercia/gists{/gist_id}","starred_url":"https://api.github.com/users/inercia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inercia/subscriptions","organizations_url":"https://api.github.com/users/inercia/orgs","repos_url":"https://api.github.com/users/inercia/repos","events_url":"https://api.github.com/users/inercia/events{/privacy}","received_events_url":"https://api.github.com/users/inercia/received_events","type":"User","site_admin":false},"body":"Listen for DNS requests on a TCP port in addition to the regular UDP port. This allows clients to resend queries when long responses are truncated with UDP.","created_at":"2015-02-11T12:35:45Z","updated_at":"2015-02-19T10:47:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dcd0f51dff76f263bbd33174381eb1a0c357bb57","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/zettio/weave/pulls/392/commits","review_comments_url":"https://api.github.com/repos/zettio/weave/pulls/392/comments","review_comment_url":"https://api.github.com/repos/zettio/weave/pulls/comments/{number}","comments_url":"https://api.github.com/repos/zettio/weave/issues/392/comments","statuses_url":"https://api.github.com/repos/zettio/weave/statuses/2838bf040a151276bfea906f10e1ffff32ac8bac","head":{"label":"inercia:weave-362","ref":"weave-362","sha":"2838bf040a151276bfea906f10e1ffff32ac8bac","user":{"login":"inercia","id":1841612,"avatar_url":"https://avatars.githubusercontent.com/u/1841612?v=3","gravatar_id":"","url":"https://api.github.com/users/inercia","html_url":"https://github.com/inercia","followers_url":"https://api.github.com/users/inercia/followers","following_url":"https://api.github.com/users/inercia/following{/other_user}","gists_url":"https://api.github.com/users/inercia/gists{/gist_id}","starred_url":"https://api.github.com/users/inercia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inercia/subscriptions","organizations_url":"https://api.github.com/users/inercia/orgs","repos_url":"https://api.github.com/users/inercia/repos","events_url":"https://api.github.com/users/inercia/events{/privacy}","received_events_url":"https://api.github.com/users/inercia/received_events","type":"User","site_admin":false},"repo":{"id":26750752,"name":"weave","full_name":"inercia/weave","owner":{"login":"inercia","id":1841612,"avatar_url":"https://avatars.githubusercontent.com/u/1841612?v=3","gravatar_id":"","url":"https://api.github.com/users/inercia","html_url":"https://github.com/inercia","followers_url":"https://api.github.com/users/inercia/followers","following_url":"https://api.github.com/users/inercia/following{/other_user}","gists_url":"https://api.github.com/users/inercia/gists{/gist_id}","starred_url":"https://api.github.com/users/inercia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inercia/subscriptions","organizations_url":"https://api.github.com/users/inercia/orgs","repos_url":"https://api.github.com/users/inercia/repos","events_url":"https://api.github.com/users/inercia/events{/privacy}","received_events_url":"https://api.github.com/users/inercia/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/inercia/weave","description":"The Docker Network","fork":true,"url":"https://api.github.com/repos/inercia/weave","forks_url":"https://api.github.com/repos/inercia/weave/forks","keys_url":"https://api.github.com/repos/inercia/weave/keys{/key_id}","collaborators_url":"https://api.github.com/repos/inercia/weave/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/inercia/weave/teams","hooks_url":"https://api.github.com/repos/inercia/weave/hooks","issue_events_url":"https://api.github.com/repos/inercia/weave/issues/events{/number}","events_url":"https://api.github.com/repos/inercia/weave/events","assignees_url":"https://api.github.com/repos/inercia/weave/assignees{/user}","branches_url":"https://api.github.com/repos/inercia/weave/branches{/branch}","tags_url":"https://api.github.com/repos/inercia/weave/tags","blobs_url":"https://api.github.com/repos/inercia/weave/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/inercia/weave/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/inercia/weave/git/refs{/sha}","trees_url":"https://api.github.com/repos/inercia/weave/git/trees{/sha}","statuses_url":"https://api.github.com/repos/inercia/weave/statuses/{sha}","languages_url":"https://api.github.com/repos/inercia/weave/languages","stargazers_url":"https://api.github.com/repos/inercia/weave/stargazers","contributors_url":"https://api.github.com/repos/inercia/weave/contributors","subscribers_url":"https://api.github.com/repos/inercia/weave/subscribers","subscription_url":"https://api.github.com/repos/inercia/weave/subscription","commits_url":"https://api.github.com/repos/inercia/weave/commits{/sha}","git_commits_url":"https://api.github.com/repos/inercia/weave/git/commits{/sha}","comments_url":"https://api.github.com/repos/inercia/weave/comments{/number}","issue_comment_url":"https://api.github.com/repos/inercia/weave/issues/comments/{number}","contents_url":"https://api.github.com/repos/inercia/weave/contents/{+path}","compare_url":"https://api.github.com/repos/inercia/weave/compare/{base}...{head}","merges_url":"https://api.github.com/repos/inercia/weave/merges","archive_url":"https://api.github.com/repos/inercia/weave/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/inercia/weave/downloads","issues_url":"https://api.github.com/repos/inercia/weave/issues{/number}","pulls_url":"https://api.github.com/repos/inercia/weave/pulls{/number}","milestones_url":"https://api.github.com/repos/inercia/weave/milestones{/number}","notifications_url":"https://api.github.com/repos/inercia/weave/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/inercia/weave/labels{/name}","releases_url":"https://api.github.com/repos/inercia/weave/releases{/id}","created_at":"2014-11-17T10:00:09Z","updated_at":"2014-11-17T10:00:10Z","pushed_at":"2015-02-18T13:26:13Z","git_url":"git://github.com/inercia/weave.git","ssh_url":"git@github.com:inercia/weave.git","clone_url":"https://github.com/inercia/weave.git","svn_url":"https://github.com/inercia/weave","homepage":"","size":1704,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"zettio:master","ref":"master","sha":"9f9949b80c15a2e3257b9d19e22a79733e2148c8","user":{"login":"zettio","id":8475709,"avatar_url":"https://avatars.githubusercontent.com/u/8475709?v=3","gravatar_id":"","url":"https://api.github.com/users/zettio","html_url":"https://github.com/zettio","followers_url":"https://api.github.com/users/zettio/followers","following_url":"https://api.github.com/users/zettio/following{/other_user}","gists_url":"https://api.github.com/users/zettio/gists{/gist_id}","starred_url":"https://api.github.com/users/zettio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zettio/subscriptions","organizations_url":"https://api.github.com/users/zettio/orgs","repos_url":"https://api.github.com/users/zettio/repos","events_url":"https://api.github.com/users/zettio/events{/privacy}","received_events_url":"https://api.github.com/users/zettio/received_events","type":"Organization","site_admin":false},"repo":{"id":23059575,"name":"weave","full_name":"zettio/weave","owner":{"login":"zettio","id":8475709,"avatar_url":"https://avatars.githubusercontent.com/u/8475709?v=3","gravatar_id":"","url":"https://api.github.com/users/zettio","html_url":"https://github.com/zettio","followers_url":"https://api.github.com/users/zettio/followers","following_url":"https://api.github.com/users/zettio/following{/other_user}","gists_url":"https://api.github.com/users/zettio/gists{/gist_id}","starred_url":"https://api.github.com/users/zettio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zettio/subscriptions","organizations_url":"https://api.github.com/users/zettio/orgs","repos_url":"https://api.github.com/users/zettio/repos","events_url":"https://api.github.com/users/zettio/events{/privacy}","received_events_url":"https://api.github.com/users/zettio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zettio/weave","description":"The Docker Network","fork":false,"url":"https://api.github.com/repos/zettio/weave","forks_url":"https://api.github.com/repos/zettio/weave/forks","keys_url":"https://api.github.com/repos/zettio/weave/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zettio/weave/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zettio/weave/teams","hooks_url":"https://api.github.com/repos/zettio/weave/hooks","issue_events_url":"https://api.github.com/repos/zettio/weave/issues/events{/number}","events_url":"https://api.github.com/repos/zettio/weave/events","assignees_url":"https://api.github.com/repos/zettio/weave/assignees{/user}","branches_url":"https://api.github.com/repos/zettio/weave/branches{/branch}","tags_url":"https://api.github.com/repos/zettio/weave/tags","blobs_url":"https://api.github.com/repos/zettio/weave/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zettio/weave/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zettio/weave/git/refs{/sha}","trees_url":"https://api.github.com/repos/zettio/weave/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zettio/weave/statuses/{sha}","languages_url":"https://api.github.com/repos/zettio/weave/languages","stargazers_url":"https://api.github.com/repos/zettio/weave/stargazers","contributors_url":"https://api.github.com/repos/zettio/weave/contributors","subscribers_url":"https://api.github.com/repos/zettio/weave/subscribers","subscription_url":"https://api.github.com/repos/zettio/weave/subscription","commits_url":"https://api.github.com/repos/zettio/weave/commits{/sha}","git_commits_url":"https://api.github.com/repos/zettio/weave/git/commits{/sha}","comments_url":"https://api.github.com/repos/zettio/weave/comments{/number}","issue_comment_url":"https://api.github.com/repos/zettio/weave/issues/comments/{number}","contents_url":"https://api.github.com/repos/zettio/weave/contents/{+path}","compare_url":"https://api.github.com/repos/zettio/weave/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zettio/weave/merges","archive_url":"https://api.github.com/repos/zettio/weave/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zettio/weave/downloads","issues_url":"https://api.github.com/repos/zettio/weave/issues{/number}","pulls_url":"https://api.github.com/repos/zettio/weave/pulls{/number}","milestones_url":"https://api.github.com/repos/zettio/weave/milestones{/number}","notifications_url":"https://api.github.com/repos/zettio/weave/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zettio/weave/labels{/name}","releases_url":"https://api.github.com/repos/zettio/weave/releases{/id}","created_at":"2014-08-18T05:19:07Z","updated_at":"2015-02-19T07:07:16Z","pushed_at":"2015-02-17T12:39:16Z","git_url":"git://github.com/zettio/weave.git","ssh_url":"git@github.com:zettio/weave.git","clone_url":"https://github.com/zettio/weave.git","svn_url":"https://github.com/zettio/weave","homepage":"","size":5533,"stargazers_count":2862,"watchers_count":2862,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":139,"mirror_url":null,"open_issues_count":82,"forks":139,"open_issues":82,"watchers":2862,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zettio/weave/pulls/392"},"html":{"href":"https://github.com/zettio/weave/pull/392"},"issue":{"href":"https://api.github.com/repos/zettio/weave/issues/392"},"comments":{"href":"https://api.github.com/repos/zettio/weave/issues/392/comments"},"review_comments":{"href":"https://api.github.com/repos/zettio/weave/pulls/392/comments"},"review_comment":{"href":"https://api.github.com/repos/zettio/weave/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/zettio/weave/pulls/392/commits"},"statuses":{"href":"https://api.github.com/repos/zettio/weave/statuses/2838bf040a151276bfea906f10e1ffff32ac8bac"}}}}