3053 Commits

Author SHA1 Message Date
ee90cbdad7 stalebot: only update one issue per run to prepare for re-enabling it (#3129) 2019-10-29 13:24:38 -07:00
5367efb805 cleanup: no x/net/context (#3120)
Manual change + mockgen
2019-10-29 13:06:26 -07:00
a8f166a036 xds: use generated files from go-control-plane (#3083)
validate needs to be removed, otherwise build fails due to duplicate
proto type registered.
2019-10-29 11:14:20 -07:00
4ec516e589 interop, examples: use localhost instead of 127.0.0.1 (#3124) 2019-10-28 14:41:46 -07:00
88080a2423 Update the comment for newCCResolverWrapper. (#3123) 2019-10-28 10:05:33 -07:00
0f2d539339 client: Keepalive pings should be sent every [Time] period (#3102)
This commit makes the following changes:
- Keep track of the time of the last read in the transport.
- Use this in the keepalive implementation to decide when to send out
  keepalives.
- Address the issue of keepalives being sent every [Time+Timeout] period
  instead of every [Time] period, as mandated by proposal A8.

Proposal A8 is here:
https://github.com/grpc/proposal/blob/master/A8-client-side-keepalive.md
2019-10-23 20:33:53 -07:00
c0909e91a5 resolver: move dns and passthrough to internal (#3116)
Nobody should directly need to reference these packages.

This is technically a breaking change. However:

- Package dns was exporting a NewBuilder method. This should never have been necessary to use, but if so, it can be replaced by importing the "grpc" package and then using resolver.Get("dns").

- Package passthrough was not exporting any symbols and there was never a need to even blank-import it.

After as much searching as possible, it appears nobody in the open source community is referencing either of these packages.
2019-10-22 13:01:54 -07:00
a7c1650ef7 fix typos (#3111) 2019-10-22 10:46:34 -07:00
041ead0785 xds: cache locality (sub-balancer) (#3067)
When a locality is removed from EDS response, it's corresponding
sub-balancer will be removed from balancer group.

With this change, the sub-balancer won't be removed immediately. It will
be kept in a cache (for 15 minutes by default). If the locality is
re-added within the timeout, the sub-balancer in cache will be picked
and re-used.
2019-10-21 15:20:28 -07:00
b53233ce4c examples: add regression test script to hello world example (#3092) 2019-10-21 13:00:46 -07:00
7c3115d8bb client: fix bug with cancellation propagation for unary RPCs (#3106) 2019-10-17 13:04:53 -07:00
5e3ef93a5f grpclb: avoid use of reflect.DeepEqual on proto.Message types (#3101) 2019-10-17 12:55:08 -07:00
7c8e60372e Add more details in ClientConn GoDoc. (#3096)
The newly added lines are mostly stolen from existing Java and C-core
documentation.
2019-10-15 09:18:24 -07:00
d5ab7434d4 credentials: accept another listen error as lack of support in test (#3097) 2019-10-14 16:16:11 -07:00
027cd627f8 Fix a data race in resolver_conn_wrapper.go (#3090) 2019-10-14 15:13:33 -07:00
0859afa33d xds: set dial target in request resource_names (#3081) 2019-10-14 09:31:56 -07:00
1610f0fd86 mod: move test/tools to a different module (#3086) 2019-10-14 09:31:07 -07:00
c0122323a5 fix typo for grpclb token key (#3094) 2019-10-14 08:57:17 -07:00
ef403a2ec1 Make healthcheck tests in end2end_test.go more readable. (#2883)
* Make healthcheck tests in end2end_test.go more readable.

- Made these tests use the default health service implementation
  wherever possible.
- Refactored some common code used in these tests into helper functions.
- Added function comments for all these tests to improve readability.

In a follow up PR, I will be moving all these tests into
healthcheck_test.go.
2019-10-11 10:38:51 -07:00
f07f2cffa0 credentials: Use net.SplitHostPort safely parse IPv6 authorities in ClientHandshake (#3082) 2019-10-09 10:48:24 -07:00
ff0c603b9b proxy_test: Fix a goroutine-leak bug in testHTTPConnect: now use channel done to store err and call t.Fatalf when err not nil (#3080) 2019-10-09 10:12:01 -07:00
2d6a3edc72 cleanup: fix typo (#3084) 2019-10-09 10:10:07 -07:00
2e7984e2c0 clientconn: override authority with address's ServerName, if set (#3073) 2019-10-08 13:59:02 -07:00
d08614fd39 examples: add UnimplementedGreeterServer in debugging example (#3079) 2019-10-05 15:38:30 -07:00
b4f13811f7 [xds_config_rename] xds bootstrap: rename helper.go to config.go (#3059) 2019-10-04 14:46:26 -07:00
df162eae76 test: embed Unimplemented___Server in every service (#3076) 2019-10-04 13:22:31 -07:00
691f3b44ba cleanup: fix various misspellings (#3075) 2019-10-04 13:07:47 -07:00
ed563a02ea resolver: add State fields to support error handling (#2951) 2019-10-04 12:59:43 -07:00
aa4eae656c Remove couple of unused fields in the resolver wrapper. (#3070) 2019-10-04 10:54:57 -07:00
50c4579fc2 examples: add Unimplemented___Server to all example servers (#3071) 2019-10-04 10:54:09 -07:00
dcd1c9748d Use exact size, if known, to allocate decompression buffer (#3048)
For large messages this generates far less garbage than ioutil.ReadAll().

Implement for gzip - RFC1952 requires it, and the Go implementation
checks it already (modulo 2^32).
2019-10-04 10:05:56 -07:00
47d3cfe042 Adding a RequestInfo struct for propagating request data to Get… (#3057)
Add a RequestInfo struct which initially is used for passing the full request method (though could later be expanded to pass more info) so that things like GetRequestMetadata can be used to apply logic based on that data.

This is a fix for #3019
2019-10-04 09:27:09 -07:00
31911ed09e client: add WithConnectParams to configure connection backoff and timeout (#2960)
* Implement missing pieces for connection backoff.

Spec can be found here:
https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md

Summary of changes:
* Added a new type (marked experimental), ConnectParams, which contains
  the knobs defined in the spec (except for minConnectTimeout).
* Added a new API (marked experimental), WithConnectParams() to return a
  DialOption to dial with the provided parameters.
* Added new fields to the implementation of the exponential backoff in
  internal/backoff which mirror the ones in ConnectParams.
* Marked existing APIs WithBackoffMaxDelay() and WithBackoffConfig() as
  deprecated.
* Added a default exponential backoff implementation, for easy use of
  internal callers.

Added a new backoff package which defines the backoff configuration
options, and is used by both the grpc package and the internal/backoff
package. This allows us to have all backoff related options in a
separate package.
2019-10-03 16:47:13 -07:00
fb2e5cdc85 server: add ServerOption HeaderTableSize (#2931) 2019-10-03 16:08:31 -07:00
3778847a73 examples: create an example for enabling and configuring retry (#3028) 2019-10-03 16:04:43 -07:00
492ab452a2 xds: incorporate changes to bootstrap file format. (#3065)
* Incorporate changes to bootstrap file format.

The format of the bootstrap file will be as follows:
{
  "xds_server": {
    "server_uri": <string containing URI of xds server>,
    // List of channel creds; client will stop at the first type it
    // supports.
    "channel_creds": [
      {
        "type": <string containing channel cred type>,
        // The "config" field is optional; it may be missing if the
        // credential type does not require config parameters.
        "config": <JSON object containing config for the type>
      }
    ]
  },
  "node": <JSON form of Node proto>
}

- Also, the bootstrap file will be read everytime a new xDS client is created.
- Change NewConfig() to not return error. Instead it just returns with
  certain fields left unspecified if it encounters errors.
- Do not fail the bootstrap process if we see unknown fields in the
  bootstrap file.
2019-10-03 15:41:16 -07:00
5bf44136bb xds: make balancer group restartable (#2999)
This is a preparing change to support priority failover. It adds start() and close() to balancer group, so we can have a balancer group that's not in use, but has all the data and is ready to be started (think about a lower priority when the higher priority is in use).

A balancer group is split into two parts: static and dynamic:

static: the data from EDS, and gets updated even if balancer group is closed
balancer IDs and builders, addresses for each balancer
dynamic: the sub-balancers
These are only created when the balancer group is started. They are closed when the balancer group is closed.
And only when the balancer group is started, the sub-balancers will get address updates.
2019-10-02 10:04:32 -07:00
2e14ef2723 transport: don't check s.header on the server side in Stream.Header (#3063)
Previously this would fall into returning the same "s.header.Copy(), nil"
condition at the end of the function, returning an empty MD.  After a recent
change it would instead check headerValid, which is always false on servers,
and return nil and an error.  Callers were ignoring this error so no behavior
change was seen, but there is no need to check s.headers here.
2019-10-02 10:00:00 -07:00
5df282efcf transport: fix race between operateHeaders and closeStream and reading headers (#3062)
headerChan isn't necessarily closed when closeStream returns; block on it in
waitOnHeader.
2019-10-02 09:59:28 -07:00
7aa94b7eef health: Use sync.RWMutex instead of sync.Mutex (#3058) 2019-10-01 13:59:53 -07:00
663e4ce0c9 client: fix race between client-side stream cancellation and compressed server data arriving (#3054)
`transport/Stream.RecvCompress` returns what the header contains, if present,
or empty string if a context error occurs.  However, it "prefers" the header
data even if there is a context error, to prevent a related race.  What happens
here is:

1. RPC starts.

2. Client cancels RPC.

3. `RecvCompress` tells `ClientStream.Recv` that compression used is "" because
   of the context error.  `as.decomp` is left nil, because there is no
   compressor to look up in the registry.

4. Server's header and first message hit client.

5. Client sees the header and message and allows grpc's stream to see them.
   (We only provide context errors if we need to block.)

6. Client performs a successful `Read` on the stream, receiving the gzipped
   payload, then checks `as.decomp`.

7. We have no decompressor but the payload has a bit set indicating the message
   is compressed, so this is an error.  However, when forming the error string,
   `RecvCompress` now returns "gzip" because it doesn't need to block to get
   this from the now-received header.  This leads to the confusing message
   about how "gzip" is not installed even though it is.

This change makes `waitOnHeader` close the stream when context cancellation happens.
Then `RecvCompress` uses whatever value is present in the stream at that time, which
can no longer change because the stream is closed.  Also, this will be in sync with
the messages on the stream - if there are any messages present, the headers must
have been processed first, and `RecvCompress` will contain the proper value.
2019-10-01 10:47:40 -07:00
861d8e7992 internal: fix typos in comments (#3046) 2019-09-30 15:30:07 -07:00
1e7ab3dab0 Move keepalive tests to a separate test file. (#3014)
This is a follow-up to https://github.com/grpc/grpc-go/pull/2992.
2019-09-30 12:44:16 -07:00
e75b8f4830 test: fix flake in GoAwayThenClose (#3052)
In the event of a race, the first server may not be fully serving before the
client attempt to connect, then the second server may attempt to field the
FullDuplexCall, which it does not implement.

Fix the race by giving the client only the first server's address until after
the FullDuplexCall is started.
2019-09-27 13:42:15 -07:00
e351044388 clientconn: fix potential deadlock caused by ResetConnectBackoff (#3051) 2019-09-27 10:51:22 -07:00
1950dc9db9 travis: add go1.13 and remove go1.10 and go1.9 without GAE (#3050) 2019-09-27 09:48:01 -07:00
275a76f490 Change version to 1.25.0-dev (#3043) 2019-09-25 14:20:15 -07:00
230def7691 docs: fix debugging README typo (#3037) 2019-09-24 16:00:30 -07:00
788ffe6275 Update governance, contributing, code of conduct docs (#3033)
* change from Inc. to LLC for Google

* Add CODE-OF-CONDUCT.md, GOVERNANCE.md and update CONTRIBUTING.md
2019-09-23 11:24:27 -07:00
6b46f470d1 client: consider service config invalid if loadBalancingConfig… (#3034) 2019-09-20 16:07:23 -07:00