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

52 Коммитов

Автор SHA1 Сообщение Дата
Menghan Li 39a411827d
internal: Update proto generated code (#2133) 2018-06-08 17:54:26 -07:00
Menghan Li 629f6bc5e5
grpclb: minor fixes on comments and tests (#2122)
* modify noimport.go panic message
* package level comments
* remove useless error check at grpclb_test.go:343
2018-06-05 13:52:07 -07:00
Carl Mastrangelo 4344c204c9 Split grpclb out of top level grpc package (#2107)
This PR splits out grpclb from grpc.  I have made the PR in several commits so you can see more clearly the steps that happened.

There are a few possibly contentious points that I would like to make clear up front:

* grpclb will no longer autoload as a load balancer.  I think this is okay, as service config is not widely (at all?) used, and I believe this is the only way to access it.
* `internal` is used more, as a way of having code shared between packages without exposing types
* ConnectivityStateEvaluator, as used by grpclb, is no longer thread safe.  I believe there is an outer mutex that guards access, but I want to point out this subtle change up here.

All but one tests pass with this, due to another cyclic dependency.  I can fix this, but it is a little more widely scoped (such as exposing grpc.server and grpc.errorDesc in the internal package).   This PR is a nearly-passing sample of that last step to get this working. 

PTAL @menghanl @dfawley
2018-06-05 09:54:12 -07:00
Menghan Li 70e9c28461
grpclb: sync messages.proto and update client load reporting (#2101) 2018-06-04 10:02:09 -07:00
Menghan Li f669235193
internal: update proto generated code (#2093) 2018-05-21 09:59:26 -07:00
Menghan Li 1bacc35978
Revert "Strip port from server name in grpclb (#2066)" (#2083)
This reverts commit d24d0a4b99.
2018-05-16 15:37:34 -07:00
Menghan Li d24d0a4b99
Strip port from server name in grpclb (#2066)
The grpclb server expects server name to not have port number
2018-05-15 11:23:12 -07:00
lyuxuan a36eb4675a
regenerate *.pb.go files due to proto-gen-go update (#2070) 2018-05-11 18:57:54 -07:00
Chyroc f8dbc38bdc Fix "deprecated" function godoc comments to match standard formatting (#2027) 2018-05-02 08:52:49 -07:00
Menghan Li e538e04cad proto: update generated code (#2039) 2018-05-01 12:53:20 -07:00
Menghan Li 844b2a520b grpclb: fix issues caused by caching SubConns (#1977) 2018-04-10 14:23:07 -07:00
Menghan Li e6549e636d
Add dial option to set balancer (#1697)
WithBalancerName dial option specifies the name of the balancer to be used by the ClientConn. Service config updates can NOT override the balancer option.
2017-12-18 15:35:42 -08:00
dfawley f4b523765c
status: add Code convenience function (#1754) 2017-12-18 15:00:50 -08:00
Daniel Nephin 4e393e0b21 grpc: fix deprecation comments to conform to standard (#1691) 2017-12-18 09:23:42 -08:00
Menghan Li dba60db4f4
Switch balancer to grpclb when at least one address is grpclb address (#1692) 2017-12-12 12:45:05 -08:00
Menghan Li 2ef021f78d
New grpclb implementation (#1558)
The new grpclb supports fallback to backends if remote balancer is unavailable
2017-11-27 11:16:26 -08:00
Gyu-Ho Lee 865013bc17 *: replace deprecated grpc.Errorf calls with status.Errorf (#1651) 2017-11-06 10:24:20 -08:00
Tom Wilkie 0c2d9db1f9 Update go_package declarations (#1593) 2017-10-23 13:43:21 -07:00
Menghan Li de0cff50aa Fix goroutine leak in grpclb_test (#1595) 2017-10-19 15:16:16 -07:00
Menghan Li d46a3655c4 Add leak goroutine checking to grpc/balancer tests (#1497) 2017-09-07 14:30:05 -07:00
Menghan Li 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
Menghan Li e696c3d4da Remove expiration_interval from grpclb message (#1477) 2017-08-28 10:30:49 -07:00
Doug Fawley 526ef32890 Rename packages for grpclb messages/service to match directory name 2017-08-25 14:34:15 -07:00
dfawley e98913eca1 fix grpclb protos to not cause re-registration of types (#1466) 2017-08-25 13:32:10 -07:00
dfawley 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
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
Menghan Li 834dbd54e0 replace 127.0.0.1 with localhost for ipv6 only environment (#1306) 2017-06-14 15:03:04 -07:00
Menghan Li 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
田欧 a94a7ac054 add license for some files (#1296) 2017-06-12 18:10:06 -07:00
Menghan Li 20e03965ab Make RPCs non-failfast in grpclb_test. (#1302) 2017-06-12 17:54:35 -07:00
Jan Tattermusch ddbf6c46a6 autofix license notice 2017-06-08 14:42:19 +02:00
Menghan Li 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
Menghan Li fc5d355228 Split grpclb client load report test to deflake test. (#1206) 2017-04-28 12:06:45 -07:00
Menghan Li 277e90a432 Client load report for grpclb. (#1200) 2017-04-27 10:43:38 -07:00
Menghan Li c73e0165df Update grpclb proto and move grpclb into package grpc (#1186) 2017-04-25 10:51:43 -07:00
Menghan Li 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
dfawley 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
Menghan Li 7fc29d0caa populate initReq target name and fix IP []byte type in grpclb (#1145) 2017-03-28 12:10:54 -07:00
Menghan Li b3cc2b5eca pick a random address if the current in use is deleted by resolver (#1135) 2017-03-28 11:13:46 -07:00
dfawley 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
Qi Zhao 8551858757 Grpclb: Support server list expiration (#962)
grpclb: Support server list expiration
2016-11-16 15:26:18 -08:00
Mahak Mukhi 883bfc7bc8 pb.go file update 2016-10-28 12:37:56 -07:00
Mak Mukhi 727a60e4d1 update server reflection code to comply with the change to the grpc generator 2016-10-21 18:06:55 -07:00
iamqizhao 2d5f9a12ea grpclb: Support DropRequest 2016-10-18 18:08:32 -07:00
iamqizhao 8930da46d0 grpclb: work with LoadBalanceToken 2016-10-13 16:54:33 -07:00
iamqizhao d8c69bd859 fix a testing.T issue 2016-10-07 16:57:44 -07:00
iamqizhao 474679aec4 grpclb: override credentials server name using the metadata in name resolution 2016-10-07 14:08:42 -07:00
iamqizhao e77c5bbb41 address the comments 2016-09-21 17:54:48 -07:00
iamqizhao 3f1de24002 fix some closing issues 2016-09-20 18:53:56 -07:00
iamqizhao 766825a8b4 fix some other issues 2016-09-20 15:56:24 -07:00