Commit Graph

3300 Commits

Author SHA1 Message Date
Eric Anderson 08aaf7a8b1 Upgrade to Mockito 1.10.19 2019-02-27 17:06:01 -07:00
Eric Anderson 0d97507919
SECURITY.md: Don't suggest users to use Jetty ALPN
I fixed many of these elsewhere in the document via 4ba168f28, but I
didn't update the troubleshooting section previously.
2019-02-27 16:32:59 -07:00
Carl Mastrangelo b86fdfa12e
all: update README to reference 1.19.0 2019-02-27 14:55:09 -08:00
sanjaypujare 5d87f8b8dd
add a missing critical whitespace (#5408) 2019-02-27 14:33:43 -08:00
Eric Anderson 1da3f65e7b SECURITY.md: tcnative/ALPN works on Alpine
In testing, I discovered that Alpine does in fact work. Update the
documentation with the error you might see if you are simply missing a
package (for Googling) as well as fixes.
2019-02-27 15:19:49 -07:00
Eric Anderson 2a3e0616ff travis.yml: Stop testing jdk9
JDK 11 is LTS and superceded JDK 9 and 10. Nobody should really be using JDK 9
(just like the already untested JDK 10) so let's not waste the CPU testing it.
As long as we support JDK 8 and 11 it is unlikely we break JDK 9, though.
2019-02-27 11:20:19 -07:00
Jihun Cho 68f6ce9ddd
all: fix publish not having checksum (#5398) 2019-02-27 09:39:02 -08:00
ZHANG Dapeng b9fb649ce1
xds: fallback handling
added fallback handling
in addition: 
- made XdsLbState not abstract for now
- did not include graceful swapping balancers when service config change, for now just shutdown the old one and use the new one.
2019-02-26 13:13:42 -08:00
Jihun Cho 539d6bf67d
all: when publishing to maven/mavenLocal excludes xds and gae-interops (#5391) 2019-02-26 12:52:06 -08:00
Nguyen Quang Huy 69a4917a8c doc: Remove some duplicated words in comment
Correct spelling for code comment.
2019-02-25 10:18:52 -08:00
ZHANG Dapeng dd466039b5
doc: Update NOTICE with xds third_party dependencies 2019-02-21 11:15:26 -08:00
Kun Zhang 83b92cfc9f
core: pass transport attributes to ClientStreamTracer.Factory.newClientStreamTracer() (#5380)
This will be a new override.  The old override is now deprecated.

In order to pass new information without adding new overrides, I shoved most information
into an object called StreamInfo.  The Metadata is left out to draw attention because
it's mutable.

Motivation: this is needed for correctly supporting pick_first in GRPCLB.  GRPCLB needs to
add a token to the headers, and the token varies among servers.  With round_robin, GRPCLB
create a Subchannel for each server, thus can attach the token when the Subchannel is picked.
To implement pick_first, all server addresses will be put in a single Subchannel, we will
need to add the header in newClientStreamTracer(), by looking up the server address from
the transport attributes and deciding which token to add.
2019-02-21 11:13:51 -08:00
Eric Gribkoff 6c32eaf9d4
okhttp: add socketFactory method to channel builder (#5378) 2019-02-20 19:17:20 -08:00
David Hoover d44d015c44 doc: Fix typo 2019-02-20 16:40:57 -08:00
Kun Zhang 86f974333e
core: delete deprecated ClientStreamTracer.Factory#newClientStreamTracer (#5377) 2019-02-20 12:07:15 -08:00
Kun Zhang b867f8e4fc
core: make NameResolver not thread-safe (#5364)
Resolves #2649

As a prerequisite, added `getSynchronizationContext()` to `NameResolver.Helper`.

`DnsNameResolver` has gone through a small refactor around the `Resolve` runnable, which makes it a little simpler.
2019-02-20 11:45:38 -08:00
Dan 05b6156d43 core: using correct key for hedging max attempts 2019-02-19 15:22:16 -08:00
Jihun Cho 5f60f22b6a netty: prevent IndexOutOfBoundsException when no handler is passed to BufferingHandler 2019-02-15 15:18:48 -08:00
Carl Mastrangelo 8e6fa122a6
netty,alts: hide ProtocolNegotiator behind an accessor, and...
...and move the `close()` method to ProtocolNegotiator rather than Handler.

Since this is a breaking change (for people who ignored our `@Internal` annotations), I wanted to make both changes in the same PR so as to fix them both at the same time.
2019-02-15 13:59:58 -08:00
ZHANG Dapeng 5ae9d91039
xds: use shadow plugin for generated code
* Import envoy proto file to the latest internal version, which has correct java proto options. (The PGV proto, `validate.proto`, doesn't have the correct and up-to-date java_package proto option yet, but as long as we don't use those generated classes, it seems fine.)
* Stop modifying java proto options by import.sh.
* Apply shadow plugin when publishing.
2019-02-15 10:19:44 -08:00
Eric Anderson b7b7322760
Update google-auth-library-java to 0.13.0
0.13.0 is the latest version.

This honestly doesn't do much since any user of our auth API will be
depending on the library themselves (we only depend on the interface; no
implementation). But getting past 0.9.1 may encourage our users to use a
newer version with better JWT handling and 0.9.1 was released 10 months
ago, so we're overdue for an update.

Fixes #4700
2019-02-15 09:38:16 -08:00
Eric Anderson 9a38dea91c Revert "core: Update gRPC to use span kind and raw full method. (#5328)"
This reverts commit d47379947f.

This caused test failures internally, where gRPC failed with
"IllegalArgumentException: Invalid trace name". Not only was this
failure unexpected, it was also weird that it failed with an
IllegalArgumentException instead of the normal StatusRuntimeException.
2019-02-13 09:44:21 -08:00
Carl Mastrangelo bb394132bd
netty: limit access to ProtocolNegotiators 2019-02-12 19:59:15 -08:00
Carl Mastrangelo 041cf2abd4
Start 1.20.0 development cycle 2019-02-12 14:46:28 -08:00
Carl Mastrangelo e5008e53fe
netty: always use double goaway for shutdown 2019-02-12 14:40:52 -08:00
Eric Anderson 8d429ab056 core: Add "fake" dependency on Guava's failureaccess
This allows users to upgrade to newer versions of Guava without breaking
the build due to missing transitive dependencies. Without it, when
increasing the Guava version to 27.0+ you see errors like:

stub/src/main/java/io/grpc/stub/ClientCalls.java:487: error: cannot access InternalFutureFailureAccess
  private static final class GrpcFuture<RespT> extends AbstractFuture<RespT> {
                       ^
  class file for com.google.common.util.concurrent.internal.InternalFutureFailureAccess not found

Note that using a runtime_dep does not fix the compilation error.

Long-term we will want our users to migrate to
jvm_maven_import_external. However, if we use it ourselves, it will
effectively require our users to use it immediately themselves. It has
low penetration today, including lack of usage by tools like
johnynek/bazel-deps.

Fixes #5214
2019-02-12 14:17:28 -08:00
Kun Zhang e875a8c6a3
core: introduce NameResolver.Helper and deprecate the params on newNameResolver() (#5345)
Context: [#4159 (comment)](https://github.com/grpc/grpc-java/issues/4159#issuecomment-415827641)

`Attributes` is appropriate for plumbing optional objects, especially useful for a long plumbing path where components in the middle may not care or see all objects in the container. It's not the case for the `params` on `newNewResolver()`. Both the default port and the proxy detector are guaranteed to be there and the plumbing path is very short. In this case, a first-class object is more appropriate and easier to use.

The `Helper` will also have `getSynchronizationContext()` (#2649) and a method to parse and validate service config. We we also considering merging `Listener` into the `Helper`, to make `NameResolver` match the `LoadBalancer` API.
2019-02-12 10:14:59 -08:00
Eric Anderson 1bead99241 core: Place Nullable annotation before modifiers
Since Nullable is not a type annotation, it is normal to put it before any
modifiers (like "private"). This fixes a lint failure.
2019-02-11 17:11:51 -08:00
Eric Anderson efa2e47335
java_grpc_library.bzl: workaround strict_deps
This is a sync from our internal copy, so has lots of small changes.
But the most important change is strict_deps issues are worked around
within the rule. This means there should be no longer any reason to
specify more than one dep.

Our Bazel CI is still on Bazel 0.20, so for the moment avoid requiring
Bazel 0.22 by staying on the old 'proto' provider instead of ProtoInfo.

Fixes #5314
2019-02-11 15:17:34 -08:00
Bogdan Drutu d47379947f core: Update gRPC to use span kind and raw full method. (#5328) 2019-02-11 11:04:20 -08:00
Yang Song b03a793405 all: upgrade OpenCensus version. (#5329) 2019-02-11 11:03:34 -08:00
Kun Zhang 138e958c4a
core: ProxiedSocketAddress on public API (#5344)
Combine the public `ProxyParameters` and the internal `ProxySocketAddress` as `HttpConnectProxiedSocketAddress`. The more specific name signifies the type of the proxy we currently support, and makes room for other proxy types (e.g., SOCKS) in the future. The combination simplifies NameResolver implementation.

Introduce `ProxiedSocketAddress` as the base class that is returned by `ProxyDetector`, mainly for clarification and documentation. Added documentation about proxy in general on `ProxyDetector`.
2019-02-11 09:56:59 -08:00
Eric Anderson 9312291d30 alts: Use absolute domain name for metadata server
This avoids using the search domains when not on GCE, which prevents
useless DNS requests.

This is the Java equivalent of grpc/grpc#17598
2019-02-08 08:28:28 -08:00
Jihun Cho 06a7c0b671
bazel: format repositories.bzl (#5339) 2019-02-07 22:57:26 -08:00
Kun Zhang 139e544338
core: RoundRobinLoadBalancer updates picker before shutting down subchannels. (#5338)
This should lower the chance of the race between the pick and the
shutdown (#2562).
2019-02-07 15:57:41 -08:00
Michael Plump bcb11b1155 core: add @CheckReturnValue to Status. 2019-02-07 14:00:10 -08:00
Eric Anderson eaca73473c
Upgrade to protobuf 3.6.1
For Bazel, we upgrade to protobuf 3.6.1.2 and javalite HEAD to fix
incompatibilities in newer Bazel releases.

compiler/Dockerfile is unused, so it was removed instead of being updated.

protoc no longer includes codegen for nano, so we remain on the older protoc
any time nano is used.

Protobuf now requires C++11 when compiling, so windows was swapped to
VC 14.
2019-02-07 13:40:53 -08:00
Danna Kelmer e4045f84c4 Stop using native maven_jar rule in grpc 2019-02-07 13:30:22 -08:00
Carl Mastrangelo c958cce744
core: fix tracking issue for port listener 2019-02-07 11:07:44 -08:00
Carl Mastrangelo dc5ec9743a
netty: add a channel active handler 2019-02-07 10:22:12 -08:00
Carl Mastrangelo f6ec07d87d
core,netty: expose listening on multiple ports 2019-02-06 15:49:59 -08:00
kenji yoshida 6b68d874f5 core: fix typo. s/intercepter/interceptor/ 2019-02-06 09:22:45 -08:00
ZHANG Dapeng ea8968beed
xds: implement xds plugin selection
- defined XdsLbState, playing a similar role to GrpclbState
- there are two modes of XdsLbState: STANDARD and CUSTOM
- on `XdsLoadBalancer.handleResolvedAddressGroups()`, the `xdsLoadBalancer` will update the `xdsLbState` based on the lb config in the attributes passed in
2019-02-05 14:07:09 -08:00
ZHANG Dapeng 2960708b38
grpclb: minor cleanup, remove unnecessary try-catch 2019-02-05 12:40:55 -08:00
Arajit Samanta 182d277b1c CONTRIBUTING.md: Fix google java style guide link (#5318) 2019-02-04 15:09:41 -08:00
Jihun Cho 71d067e8f5
netty: add channelFactory to NettyChannelBuilder (#5312)
add channelFactory in NettyChannelBuilder & NettyClientTransport
2019-02-04 10:51:23 -08:00
Carl Mastrangelo 3a39b81cf5
all: remove java6 type args 2019-02-04 10:03:50 -08:00
Tim van der Lippe a31473ef20 all: fix usages of any(<Primitive>.class) matchers
In Mockito 2, if a method expects a primitive type, but an any(<Primitive>.class) matcher is used in its place, it will throw an error. To prepare for this upcoming breakage, change
all existing any(<Primitive>.class) matchers to use the correct any<Primitive>() matcher.
2019-02-04 09:01:00 -08:00
ZHANG Dapeng 0dbab26bb4
all: fix lint 2019-02-01 17:06:27 -08:00
apolcyn 574c053ebb interop-testing: Add GoogleDefaultCreds test case for java 2019-02-01 16:49:54 -08:00