25 Commits

Author SHA1 Message Date
d46a3655c4 Add leak goroutine checking to grpc/balancer tests (#1497) 2017-09-07 14:30:05 -07:00
8233e124e4 Add new Resolver and Balancer APIs (gRFC L9) (#1408)
- Add package balancer and resolver.
 - Change ClientConn internals to new APIs and adds a wrapper for v1 balancer.
2017-08-31 10:59:09 -07:00
e696c3d4da Remove expiration_interval from grpclb message (#1477) 2017-08-28 10:30:49 -07:00
e98913eca1 fix grpclb protos to not cause re-registration of types (#1466) 2017-08-25 13:32:10 -07:00
25b4a426b4 go-generate pb.go files and check in Travis to make sure they don't change (#1426) 2017-08-17 16:00:51 -07:00
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
834dbd54e0 replace 127.0.0.1 with localhost for ipv6 only environment (#1306) 2017-06-14 15:03:04 -07:00
1ab4adf22d Support ipv6 addresses in grpclb (#1303)
Add square brackets to ipv6 addresses, otherwise net.Dial() and
net.SplitHostPort() will return too many colons error.
2017-06-13 13:43:09 -07:00
20e03965ab Make RPCs non-failfast in grpclb_test. (#1302) 2017-06-12 17:54:35 -07:00
ddbf6c46a6 autofix license notice 2017-06-08 14:42:19 +02:00
07bd9434fa Pass custom dialer to balancer (#1205)
* Pass custom dialer to balancer
* add test for passing custom dialer
* add grpclb package comment
2017-05-11 10:10:19 -07:00
fc5d355228 Split grpclb client load report test to deflake test. (#1206) 2017-04-28 12:06:45 -07:00
277e90a432 Client load report for grpclb. (#1200) 2017-04-27 10:43:38 -07:00
c73e0165df Update grpclb proto and move grpclb into package grpc (#1186) 2017-04-25 10:51:43 -07:00
8a6eb0f6e9 grpclb should connect to the second balancer (#1181)
grpclb needs to connect the second resolved balancer address when the first balancer disconnects.
If grpclb gets 2 resolved addresses: balancer1 and balancer2. When balancer1 disconnects, grpclb should automatically start to use balancer2.
2017-04-13 13:41:35 -07:00
0c1d39df28 Separate incoming and outgoing metadata in context
This will prevent the incoming RPCs' metadata from appearing in outgoing RPCs
unless it is explicitly copied, e.g.:

incomingMD, ok := metadata.FromContext(ctx)
if ok {
  ctx = metadata.NewContext(ctx, incomingMD)
}

Fixes #1148
2017-04-07 11:54:56 -07:00
7fc29d0caa populate initReq target name and fix IP []byte type in grpclb (#1145) 2017-03-28 12:10:54 -07:00
c5a5dbc500 Don't return an error from dial if the balancer returns no initial servers (#1112)
This modifies the WithBlock behavior somewhat to block until there is at least
one valid connection.  Previously, each connection would be made serially until
all had completed successfully, with any errors returned to the caller.  Errors
are now only returned due to connecting to a backend if a balancer is not used,
or if there is an error starting the balancer itself.

Fixes #976
2017-03-21 11:35:53 -07:00
8551858757 Grpclb: Support server list expiration (#962)
grpclb: Support server list expiration
2016-11-16 15:26:18 -08:00
2d5f9a12ea grpclb: Support DropRequest 2016-10-18 18:08:32 -07:00
8930da46d0 grpclb: work with LoadBalanceToken 2016-10-13 16:54:33 -07:00
d8c69bd859 fix a testing.T issue 2016-10-07 16:57:44 -07:00
474679aec4 grpclb: override credentials server name using the metadata in name resolution 2016-10-07 14:08:42 -07:00
e77c5bbb41 address the comments 2016-09-21 17:54:48 -07:00
f02984b7c6 Basic support of grpclb 2016-09-19 15:11:57 -07:00