Commit Graph

3380 Commits

Author SHA1 Message Date
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
Jihun Cho ef6b6169f8
Adding Bom (#5209) 2019-02-01 14:00:05 -08:00
Eric Anderson 4a3f28f45f context: fix detaching ROOT
If you attach literal ROOT to the thread, if anyone else restores root
it will set the thread local to be null. This broke the "are you
detaching the current context" check, as ROOT != null. This was a
regression introduced in 55b08e67d.
2019-02-01 11:56:20 -08:00
Jihun Cho 83db004837
alts: fix missing dependencies (#5307)
fix missing dependencies for grpc-alts by using java plugin
2019-02-01 11:02:16 -08:00
Eric Anderson ddb16c5b4b Upgrade Guava to 26.0-android
This reverts commit 4adcf24363. The downgrade of
Guava has gone out in a release, so we can upgrade it again in the next
release.
2019-02-01 10:16:38 -08:00
Eric Anderson 723851627e okhttp: Remove DEFAULT_CONNECTION_SPEC from builder
This will reduce the method count, as okhttp's copy of ConnectionSpec will no
longer be retained when ProGuarded. It was deprecated in 25f357699, 10 months
ago.
2019-02-01 09:36:37 -08:00
Jihun Cho 1c3432c3fb
all: migrate gradle publish from maven to use maven-publish plugin (#5289) 2019-01-31 17:38:43 -08:00
Eric Anderson c75d9bc19f core: Fix racy creation/set of the retry Future
This fixes two races: a data race where scheduledRetry is accessed
by cancel() and confusion where scheduledRetry could be set to null by
the schedule()d runnable before it is set by the schedule() return
value.

Although it seems these races can't actually cause problems due to other
conditions/constraints, it's hard to reason about. So let's plug these
preemptively, even if we can't add tests that trigger them.

ScheduledHedging was not specific to hedging, so can now be reused for
this retry case. It was renamed to avoid being misleading.
2019-01-31 16:24:34 -08:00
ZHANG Dapeng d0ecc08705
all: fix lint 2019-01-31 09:31:13 -08:00
Eric Anderson 473a7d1ce7
interop-testing: Simply ProxyTest and shutdown handling 2019-01-30 16:23:26 -08:00
Eric Gribkoff b7cf75fac1
cronet: avoid NPE in writeHeaders after transport shutdown (#5275) 2019-01-30 11:01:30 -08:00
Jihun Cho 9c796ac23d examples: fix the logger name to match actual class. This PR was originally made by chengsluo (#5159) 2019-01-30 10:42:19 -08:00
Carl Mastrangelo ed0a9f3f1d
netty: support listening on multiple ports 2019-01-29 10:13:40 -08:00
Eric Anderson 4ba168f28a
SECURITY.md: Rewrite/reflow our recommendations
Much of these sections pre-dated gRPC 1.0 and Java 9. Modernize them to be more
on-point and clear.
2019-01-28 16:26:44 -08:00
Eric Anderson 55b08e67d4 context: Avoid leaking ClassLoader through ThreadLocal 2019-01-28 13:54:52 -08:00
Carl Mastrangelo 27253353e7
core: fix service config prefix matching in Dns
Fixes #5280
2019-01-28 12:46:23 -08:00
Eric Gribkoff ce2ae1fb6c
core: remove channel reference from ManagedChannelWrapper (#5283)
This avoids a memory leak when the channel itself participates in a
reference cycle (e.g., when an interceptor retains a reference to an
Android app's context). With the current implementation, the static
`ManagedChannelOrphanWrapper.refs` map will keep the channel reachable
and prevent the ref cycle from being GCed.
2019-01-25 16:36:04 -08:00
Eric Gribkoff f973bbc06f
Revert "buildscripts: disable android size status check (#5278)" (#5284)
This reverts commit aaa3a86dd2.
2019-01-25 16:16:41 -08:00
Carl Mastrangelo 6c8020e584
all: fix formatting on bzl file 2019-01-25 16:13:46 -08:00
Carl Mastrangelo f6689a1f86
all: fix lint errors 2019-01-25 16:09:59 -08:00
Carl Mastrangelo 32fc0bcd38
services: set the default serving state of all services to SERVING 2019-01-24 15:19:51 -08:00