Граф коммитов

2 Коммитов

Автор SHA1 Сообщение Дата
Menghan Li 963eb485d8 Fix missing and wrong license (#1422) 2017-08-04 13:46:18 -07:00
lyuxuan a56843968d DNS resolver (#1300)
* initial dns resolver impl

* add srv lookup

* more srv

* change from string to Update

* added port handling

* a complete draft for dns resovler except the polling mechanism

* added sleep to infrequently poll the DNS server

* commented out test case since they are not portable

* remove duplicate declaration/definition in grpclb

* change namespace for grpclb structures

* goimports gofmt

* fix sorting issue

* implement sort.Interface

* different sort implementation for different go version

* add missing files

* fix missing comments

* handle err

* fix comments: unexport dnsResolver and dnsWatcher, add chan to exit Next(), add freq to control polling frequency

* enhance target string handling, add static IPWatcher, add mock test

* debug travis

* disable real address resolver test, since travis return 3 resolved IPs, 2 of them are duplicates

* shorten test time by reduce sleep time in TestIPWatcher, since it doesn't really do the DNS round trip

* resolve data race

* resolve data race using waitgroup

* reimplement setHostPort, compileUpdate, unexport ipWatcher

* delete sort related stuff, fix close bug for Next(), fix compileUpdate bug(change to map[Update]bool, plus fix minor review comments

* fix minor test case

* minor change to Next()

* use net.DefaultResolver with context as input

* add different build rules for lookupHost and lookupSRV

* minor fix

* go1.6 shall fail, but 1.7, 1.8 should pass

* go1.6 is expected to pass

* all go version should pass, added pre17 and 17 for replaceNetFunc to handle context problem

* rename test helper file name. should fix build problem

* goimports

* fix 1.7 context problem

* reformat dns_resolver_test structures

* change Next() behavior to have equal stalling interval between each lookup. Restructure dns_resolver_test.

* gofmt

* update go17_test.go, go18_test.go to reuse code. dns_resolver_test: check result and behavior correctness separately.

* update Next() logic
2017-07-24 17:17:45 -07:00