Commit Graph

3039 Commits

Author SHA1 Message Date
Michael Hudson-Doyle d5a36f00e6 credentials/alts: Assume not running on GCP if DMI not present (#2996)
fixes #2995
2019-08-26 17:06:13 -07:00
Easwar Swaminathan 45bd2846a3
Use sync.Cond to implement keepalive dormancy. (#2987)
The current code was using a buffered channel which was used to signal
whether the keepalive goroutine should enter dormancy or if it should be
awaked from sleep. Using sync.Cond makes the code much simpler to read,
and also improves the performance numbers in all but one front.
2019-08-26 15:01:49 -07:00
Srini Polavarapu ad20eafd48
change from Inc. to LLC for Google (#2997) 2019-08-26 12:49:55 -07:00
Michael Le 0574097d67 example: use proto message Get methods in helloworld (#2990) 2019-08-22 13:56:23 -07:00
Easwar Swaminathan 6fb38bdee1
Fix a bug in benchmark code. (#2989)
Total number of Allocs and AllocedBytes retrieved from
runtime.Memstats() were not being divided by the number of completed
operations during the benchmark run, to get the correct number of
Allocs/op and Bytes/op.
2019-08-21 15:24:29 -07:00
Easwar Swaminathan dc1875474e
Implementation of the xds_experimental resolver. (#2967)
This resolver doesn't do much at this point, except returning an empty
address list and a hard-coded service config which picks the xds
balancer with a round_robin child policy.

Also moved the xdsConfig struct to the xds/internal package and exported
it as LBConfig, so that both the resolver and the balancer packages can
make use of this.
2019-08-21 11:24:53 -07:00
Mats Stichel 3bb34e5324 bufconn: Implement read/write deadlines (#2959) 2019-08-20 10:47:14 -07:00
Can Guler 7cc213310c
internal: fix context leak when stream is not created successfully #2985 2019-08-19 10:04:28 -07:00
Srini Polavarapu 451cf373a7
add MAINTAINERS.md (#2971) 2019-08-16 15:27:54 -07:00
Easwar Swaminathan c26cd97e18
transport: make http2Client.getStream() to only return a stream. (#2984)
Suggested in https://github.com/grpc/grpc-go/pull/2980.
2019-08-16 11:25:09 -07:00
David Zbarsky 030824531b transport: remove defer in http2Client.getStream (#2980) 2019-08-15 11:50:32 -07:00
Can Guler 24a4d6eb88
Change version to 1.24.0-dev (#2974) 2019-08-13 15:49:38 -07:00
Doug Fawley ee21c923a2
transport: block reading frames when too many transport control frames are queued (#2970)
Addresses CVE-2019-9512 (Ping Flood), CVE-2019-9514 (Reset Flood), and CVE-2019-9515 (Settings Flood).
2019-08-13 10:52:26 -07:00
Menghan Li ee87494b1f transport: fix race between header and RPC cancellation (#2947) 2019-08-12 08:51:22 -07:00
Andrew Lazarev b8d2675446 wrr: add EDF implementation of weighted round robin. (#2957) 2019-08-09 10:19:17 -07:00
ruiHut a074ab2dcf internal: fix a typo. (#2964) 2019-08-09 10:02:03 -07:00
Easwar Swaminathan 36ddeccf18
Move code out of balancer/xds. (#2950)
We will have a root level xds/ directory which will eventually contain
all xDS implementation including balancer, resolver, client etc.

The new structure looks something like this:

grpc/
|
+--xds/
    |
    +--internal/
    |  |
    |  +--balancer/
    |     |
    |     +--edsbalancer/
    |     |
    |     +--lrs/
    |     |
    |     +--orca/
    |
    +--experimental/

Users need to import grpc/xds/experimental package to get all xds
functionality, and this will eventually be moved to grpc/xds.

Also, moved grpc/balancer/internal/wrr to grpc/internal/wrr.
2019-08-07 14:46:10 -07:00
Menghan Li fde0cae1c4
stream: call stats handler if the attempt failed to get transport (#2962) 2019-08-07 13:22:33 -07:00
lzhfromustc cd5357d62e Change Unlock to defer Unlock, to avoid data race (#2953) 2019-08-07 12:57:49 -07:00
Can Guler 1f154c6e18
stream: fix panic caused by failing to get a transport for a retry attempt (#2958) 2019-08-06 15:36:33 -07:00
Andrew Lazarev a2bdfb40ff balancer: populate endpoint weight by edsbalancer for weighted_round_robin (#2945) 2019-08-06 09:34:46 -07:00
David Zbarsky 92635fa6bf server: avoid call to trace.FromContext and resulting allocations when tracing is disabled (#2926) 2019-07-30 10:14:53 -07:00
Menghan Li a4f24690a4
internal: log when connection is closed due to keepalive (#2940) 2019-07-29 14:33:10 -07:00
Fabian Holler 120728e1f7 client: log balancer info messages only for verbosity level >=2 (#2908)
The pickfirstBalancer and baseBalancer are logging a lot of messages under normal operation.  Those messages can not be associated to a server connection because no connection address is part of the messages. They are messages that are only useful when debugging issues.

Only log them when the verbose level is at least 2, to reduce the amount of log messages under normal operation.
2019-07-25 13:25:20 -07:00
Zeming YU 6d6c0413c7 test: fix race reading while incrementing (#2935)
Swap the `<-done` and `if numConns < 2` to make sure `numConns++` happens before read
2019-07-25 10:54:14 -07:00
ajwerner b5748caae7 server: populate WireLength on stats.InPayload for unary RPCs (#2932)
Fixes #2692 which was incompletely fixed by #2711.

Also adds updates stats/stat_test.go to sanity check WireLength.
2019-07-24 16:24:45 -07:00
Jon San Miguel 61f27c1415 status: Implement *statusError.Is (#2868) 2019-07-24 14:40:29 -07:00
David Zbarsky 5da5b1f225 status: avoid allocations when returning an OK status (#2929) 2019-07-24 10:57:23 -07:00
David Zbarsky decb43806d http2client: remove unnecessary allocations for header fields (#2925) 2019-07-24 10:32:39 -07:00
Doug Fawley 977142214c
client: fix race between transport draining and new RPCs (#2919)
Before these fixes, it was possible to see errors on new RPCs after a
connection began draining, and before establishing a new connection.  There is
an inherent race between choosing a SubConn and attempting to creating a stream
on it.  We should be able to avoid application-visible RPC errors due to this
with transparent retry.  However, several bugs were preventing this from
working correctly:

1. Non-wait-for-ready RPCs were skipping transparent retry, though the retry
design calls for retrying them.

2. The transport closed itself (and would consequently error new RPCs) before
notifying the SubConn that it was draining.

3. The SubConn wasn't synchronously updating itself once it was notified about
the closing or draining state.

4. The SubConn would go into the TRANSIENT_FAILURE state instantaneously,
causing RPCs to fail instead of queue.
2019-07-22 16:07:55 -07:00
Menghan Li a975db9349
grpclb: enable keepalive (#2918)
So grpclb client will reconnect when the connection is down (e.g. proxy
drops the server side connection but keeps the client side).
2019-07-22 12:44:59 -07:00
David Zbarsky c654cab129 server: avoid allocations related to tracking excessive pings (#2923) 2019-07-22 09:56:26 -07:00
David Zbarsky 04c71b7aac server: avoid an unnecessary allocation per-RPC for OK status (#2920) 2019-07-22 09:53:08 -07:00
Menghan Li 207b5d8038
xds: instructions for regenerating proto (#2898) 2019-07-18 13:52:50 -07:00
Menghan Li f7de2c8d62
balancer: filter out grpclb addresses if balancer is not grpclb (#2907) 2019-07-17 15:08:56 -07:00
Doug Fawley 64ddb19a93
client: fix canceled vs deadline exceeded double-check logic (#2906) 2019-07-16 09:41:37 -07:00
Doug Fawley 24b2fb8959
client: remove option to send RPCs before HTTP/2 handshake is completed (#2904) 2019-07-12 13:37:27 -07:00
Doug Fawley 59fd1f3d41
server: immediately close all connections created after GracefulStop (#2903)
Internal cleanup: replace quit/quitOnce/done/doneOnce with grpcsync.Events.
2019-07-12 13:14:19 -07:00
Doug Fawley 12906490e0
docs: clarify "deprecated" to indicate whether some features may be removed in 1.x (#2900)
Also, deprecate WithBalancerName (was experimental).

The decision of whether something may be removed is based on if it was marked experimental as of v1.0/GA or upon its introduction, in accordance with Documentation/versioning.md.
2019-07-11 14:05:18 -07:00
Menghan Li 08d23162a9
grpclb: recreate SubConns when switching fallback (#2899)
With pickfirst, the same SubConn is reused, only addresses are updated.
But backends and fallbacks may need different credentials. This change
force-removes all SubConns when switching fallback.
2019-07-10 13:56:55 -07:00
Menghan Li 8e511dc15f
xds: update proto (#2896) 2019-07-08 16:47:29 -07:00
Doug Fawley 005a2997ef
Change version to 1.23.0-dev (#2893) 2019-07-03 09:06:53 -07:00
lyuxuan 73b304d882
xds: bazel proto gen code generation scripts (#2775) 2019-06-27 15:18:59 -07:00
Menghan Li 95da23bbf9
xds: load report for server loads (from trailer) (#2870) 2019-06-26 12:49:37 -07:00
Menghan Li 5caf962939
client: addrConn NewStream and health check cleanup (#2848) 2019-06-26 11:15:17 -07:00
Can Guler 915d20dcdb
grpc: change type of Server.conns
Change Server.conns from a map[io.Closer]bool to a map[transport.ServerTransport]bool.
2019-06-26 11:09:45 -07:00
Yongzheng Lai 7472edcc1e metadata: write original md before appended md (#2879) 2019-06-25 10:34:12 -07:00
Easwar Swaminathan 70e8b38052
test: end2end test improvements separate server and client configs. (#2877)
- Seperated and documented the options for client and server sides.
- Better support for multiple grpc.Servers. This will be used in other
  improvements that I have in the works.
- Moved some common functionality from channelz_test.go to
  end2end_test.go.
- Added an option to use the default health service implementation, instead
 of each test creating a new health.Server and passing it in. The
 inidividual tests have not been changed in this PR. I will do that in a
 follow up PR to keep the changes to a reasonable size.
- Fixed one of the tests which had to be fixed because of the separation
  of client and server configs.
2019-06-24 14:53:45 -07:00
Menghan Li e8b58ff637
[xds_ignore_weight_0_localities] xds: ignore localities with weight 0 (#2875)
Locality weighted load balancer can be enabled by setting an option in
CDS, and the weight of each locality. Currently, without the guarantee
that CDS is always sent, we assume locality weighted load balance is
always enabled, and ignore all weight 0 localities.
In the future, we should look at the config in CDS response and decide
whether locality weight matters.
2019-06-24 09:40:15 -07:00
Menghan Li 43c0599b22
test: fix flaky grpclb TestDropRequest (#2865) 2019-06-24 09:38:28 -07:00