Commit Graph

1383 Commits

Author SHA1 Message Date
Eric Anderson f8f86da480 core: Add missing synchronization in KeepAliveManager 2018-11-06 09:28:38 -08:00
Eric Anderson 424daa0920 core: Improve error for Auto-LB configuration failure
The ManagedChannelImpl change prevents any LB initialization failure
from producing a useless exception like:
java.lang.NullPointerException
	at io.grpc.internal.ManagedChannelImpl.shutdownNameResolverAndLoadBalancer(ManagedChannelImpl.java:321)
	at io.grpc.internal.ManagedChannelImpl.panic(ManagedChannelImpl.java:738)
	at io.grpc.internal.ManagedChannelImpl$1.uncaughtException(ManagedChannelImpl.java:144)

Instead, now it will have the expected panic behavior of an INTERNAL
Status with a proper cause.

Since the NPE in AutoConfiguredLoadBalancerFactory wouldn't mean much to
users, it now has a more explicit message.
2018-11-05 14:08:50 -08:00
ZHANG Dapeng 85b244bb41
core,netty,testing: Support dup headers joined with commas
Following the [spec](https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md) on duplicate header names:

**Custom-Metadata** header order is not guaranteed to be preserved except for values with duplicate header names. Duplicate header names may have their values joined with "," as the delimiter and be considered semantically equivalent. Implementations must split Binary-Headers on "," before decoding the Base64-encoded values.
2018-11-01 16:17:05 -07:00
zpencer 3d51756d61
core, services: fix more import lints (#5021) 2018-11-01 16:14:42 -07:00
Kun Zhang f5d0f40bdf
services: client-side health checking main implementation (#5014)
Spec: https://github.com/grpc/proposal/blob/master/A17-client-side-health-checking.md

This comes in the form of a wrapper LoadBalancerFactory. The public wrapping utility and the wrapping of RoundRobinLoadBalancer will come in follow-up changes.
2018-10-31 09:29:46 -07:00
zpencer f3e371c712
core, grpclb: fix import lints (#5017) 2018-10-30 14:24:02 -07:00
Kun Zhang 7d19683018
core: suggest LoadBalancer.Helper.createSubChannel() to be called from SynchronizationContext (#5016)
Because otherwise the user logic around Subchannel creation will
likely to race with handleSubchannelState().

Will log a warning if LoadBalancer.Helper.createSubChannel() is called
outside of the SynchronizationContext.

Adds SynchronizationContext.throwIfNotInThisSynchronizationContext()
to facilitate this warning.  It can also be used by LoadBalancer
implementations to make it a requirement.
2018-10-30 07:22:15 -07:00
Kun Zhang 4c6e202df3
core: service-loader-based LoadBalancerProvider (#4996)
LoadBalancerProvider is the interface that extends LoadBalancer.Factory. LoadBalancerRegistry is the one that loads the providers through service loader, and allows users to access providers through their names.

pick_first and round_robin balancer factories, which are experimental public API are now deprecated. Their providers are internal, as they are accessible by policy name.

AutoConfiguredLoadBalancerFactory is modified to access implementations purely by their names, thus hard-coded class names are no longer needed, and it can support arbitrary policy selected by service config.
2018-10-29 10:39:11 -07:00
Eric Anderson e5339d25c6 core: Trim trailing dot from SRV hostnames
The trailing dot denotes the hostname to be absolute. It is fine to
leave, but removing it makes the authority match the more common form
and hopefully reduces confusion.

This happens to works around SNI failures caused when using gRPC-LB,
since SNI prohibits the trailing dot. However, that is not the reason
for this change as we have to support users directly providing a
hostname with the trailing dot anyway (and doing so is not hard).

See #4912
2018-10-26 17:13:16 -07:00
Carl Mastrangelo dabe719913
core: add option to fail tests that use Status.equals 2018-10-26 16:27:03 -07:00
Eric Anderson acf62ab0c8 core: Make MetadataApplier an interface again
Swapping MetadataApplier to an abstract class is not ABI-safe for
callers. So I revert back to the previous interface definition and
introduce a CallCredentials2.MetadataApplier which is an abstract class.
Once everyone is on CallCredentials2 then we can swap it to an abstract
class again.

Fixes #5002
2018-10-26 10:15:10 -07:00
zpencer d7af1ee874
core: fix FakeClock, SynchronizationContext lints (#4991)
Fix lints for import.

Remove unused vars. Make path and package match so tests run
successfully internally.
2018-10-25 10:00:55 -07:00
Kun Zhang 7582049a95
core: SynchronizationContext exposed by LoadBalancer.Helper (#4971)
Provides a `SynchronizationContext` for scheduling tasks, with and without delay, from LoadBalancer implementations. This absorbs and extends the internal utility `ChannelExecutor`. It supersedes `Helper.runSerialized()`, which is now deprecated.

# Motivation

I see multiple cases that schedule tasks with a delay while requiring the task to run in the "Channel Executor". There have been repeated work to wrap scheduled tasks and handle races between cancellation and task run (see the diff in `GrpclbState.java` for example). The LoadBalancer implementation (e.g., GrpclbLoadBalancer) also has to acquire the `ScheduledExecutorService` from somewhere and release it upon shutdown.

The upcoming HealthCheckLoadBalancer (#4932), which would use back-off policy to retry health-checking streams, would have to do all the things above. At this point I think we need to provide something that combines `runSerialized()` with a scheduled executor with the same synchronization guarantees.

# Design details

`SynchronizationContext` is a similar to `ScheduledExecutorService` but tailored for use in `LoadBalancer` and potentially other cases outside of `LoadBalancer`. It offers task queuing and serialization and delayed scheduling. It guarantees non-reentrancy and happens-before among tasks. It owns no thread, but run tasks on caller's or caller-provided threads.

All channel-level state mutations and callback methods on `LoadBalancer` are done in a SynchronizationContext, which was previously referred to as "Channel Executor". 

`SynchronizationContext.schedule()` returns a `ScheduledHandle` for status checking and cancellation. `ScheduedFuture` from `SchedulingExecutorService.schedule()` is too broad for our use cases (e.g., the blocking `get()` should never be used).

`SynchronizationContext.schedule()` requires a `ScheduledExecutorService`, which is now available through `Helper.getScheduledExecutorService()`. LoadBalancers don't need to worry about where to get `SchedulingExecutorService` any more.

# Alternatives

Alternatively, we could keep `Helper.runSerialized()` and add something like `Helper.runSerialiezdWithDelay()`, but having them on their own interface allows clean fake implementation by `FakeClock` for test, and allows other components (potentially `InternalSubchannel` for reconnection backoff) to use it too.

Instead of asking caller of `schedule()` to provide the `ScheduledExecutorService`, we considered having SynchronizationContext take a `ScheduledExecutorService` at construction. It would be inconvenient for LoadBalancer implementations that don't use `schedule()`, as they would be forced to provide a fake `ScheduledExecutorService` (which is cumbersome).

Instead of making `SynchronizationContext` a (semi-)concrete class, we considered making it an pure abstract class. However, we found it nontrivial to implement `execute()` correctly with the non-reentrancy guarantee.
2018-10-23 15:25:15 -07:00
Kun Zhang ade5c497f4
Revert "core: promote CallCredentials API v2. (#4952)" (#4983)
This reverts commit ef8a84421d.

Firebase is not yet ready to migrate to the new API. Will try again once we made the release and migrated them to CallCredentials2.
2018-10-22 16:43:37 -07:00
Thomas Broyer 183e1f6735 all: update Error Prone to 2.3.2
This will allow enabling Error Prone on JDK 10+ (after
updating the net.ltgt.errorprone plugin), and is also a
prerequisite to that plugin update.

Also remove net.ltgt.apt plugin, as Gradle has native
support for annotationProcessor.
2018-10-19 13:08:36 -07:00
Kun Zhang 9aaf29c5e6
core: annotate Attributes key annotations as experimental API. (#4974)
Also annotate NameResolver.Listener as experimental because
annotations of an outer class don't show in the javadoc page of its
inner classes.
2018-10-19 13:04:32 -07:00
Carl Mastrangelo 93d9b32d12
core: ignore localhost and IP addresses for JNDI
This change is mainly to fix a test, but it also is an implementation of the proposal here: https://github.com/grpc/proposal/pull/79

In short:

* Do not do SRV or TXT lookups when the target name is `localhost`.  This can be overriden by a system property
* Do not do SRV or TXT lookups when the target name is an IPv6 or IPv4 address.  This _cannot_ be overriden.  The constructed domains for these queries would themselves not be valid.  (e.g. _grpclb._tcp.192.168.0.1)
* Speeds up initial connection when communicating over local host, since it is extremely uncommon that such a connection would need gRPCLB or SRV records

I expect to remove the system property after a release if no one asks about it.
2018-10-19 12:19:36 -07:00
Eric Anderson b7c3d276c9 core: Add maxInboundMetadataSize to builders
This is a rename of the pre-existing Netty builder method, so aliases
were added to the Netty builders.

Fixes #4050. This API was a minor rename to the pre-existing Netty API,
so has already undergone API review and thus is not ExperimentalApi.
2018-10-18 14:34:03 -07:00
Eric Anderson 0eefa5263b inprocess: Add maxInboundMetadataSize 2018-10-18 14:34:03 -07:00
Eric Anderson 0fbc1153bd testing: Add transport tests for maxInboundMetadataSize 2018-10-18 14:34:03 -07:00
Jihun Cho b7dc501bbe core: For Android, ignores DNS cache
There is a known issue that causes DNS lookup issue when network
siwtchover on android. This issue is tracked separately in #4962.
This change simply disables DNS cache to avoid the issue on Android.
2018-10-17 22:51:43 -07:00
Jihun Cho 0a7fa14042 core: Roll forward "core: DnsNameResolver caches refresh (#4812)"
This reverts commit 0e8cf58d1a.
2018-10-17 22:51:43 -07:00
Carl Mastrangelo c729a0f76b
core: enable SRV records lookup 2018-10-16 10:10:08 -07:00
Kun Zhang 6adc1797c9
core: finalize convenient overrides on LoadBalancer.Helper and Subchannel. (#4954)
Those overrides are kept for backward compatibility and convenience
for callers.  Documentation already says implementations should not
override them.  Making them final reduces confusion around which
override should be verified in tests and be overridden in forwarding
classes, thus prevents bugs caused by such confusion.
2018-10-16 09:43:58 -07:00
Carl Mastrangelo 60b02c0b9c
core: throw exception on resolution failure and no jndi resolver 2018-10-15 16:59:02 -07:00
Kun Zhang c528df8ae8
core: add internal Subchannel.asChannel() (#4950)
Returns a Channel that allows a LoadBalancer to make auxiliary RPCs on already-established application connections. We need this to implement client-side health-checking (#4932)

See comments on the API for its semantics.

Notable changes:

- Transports are modified to use InUseStateAggregator so that they can exclude RPCs made on Subchannel.asChannel() when reporting in-use state for idle mode.
- OobChannel shares the same Executor as Subchannel.asChannel(). Because the latter is not a ManagedChannel and doesn't have life-cycle, thus can't determine when to return the Executor to a pool, the Executor is now returned only when ManagedChannelImpl is terminated.
2018-10-15 15:39:21 -07:00
Kun Zhang ef8a84421d
core: promote CallCredentials API v2. (#4952)
This is Step 3 of #4901.  The old interface has been deprecated in the
latest release.  Now it's time to replace it with the new API.
2018-10-15 15:37:20 -07:00
Carl Mastrangelo 6b7c8694a9
core: make DnsNameResolver Error on empty addresses
This change does 3 main things (in 3 commits):

1.  Refactor the resolution runnable to be testable
2.  Add Finer level logging to aid in debugging
3.  Check that there are addresses before passing them to ManagedChannelImpl.
2018-10-12 18:11:45 -07:00
ZHANG Dapeng 595e5acfd1
core: temporarily disable census when enableRetry 2018-10-12 16:42:51 -07:00
Jihun Cho 2ce6ddfb5c core: removed unused expression 2018-10-12 16:18:03 -07:00
Jihun Cho 0e8cf58d1a Revert "core: DnsNameResolver caches refresh (#4812)"
This reverts commit 189991012b.
2018-10-12 15:30:38 -07:00
Jihun Cho c24f2fd25b Revert "core: android use smaller(2s) DNS cache TTL (#4943)"
This reverts commit ecb206f277.
2018-10-12 15:30:38 -07:00
creamsoup ecb206f277
core: android use smaller(2s) DNS cache TTL (#4943)
android use smaller (2s) DNS cache TTL
2018-10-12 13:56:49 -07:00
Carl Mastrangelo d06c8e3bf7
core: include what name resolver was used when it fails 2018-10-11 13:39:20 -07:00
Eric Anderson 967cc64770 Start 1.17.0 development cycle 2018-10-11 09:29:23 -07:00
Kun Zhang 861f9147ed
core: add CallCredentials2 and deprecate CallCredentials' old interface (#4902)
This is the first step of smoothly changing the CallCredentials API.

Security level and authority are parameters required to be passed to
applyRequestMetadata(). This change wraps them, along with
MethodDescriptor and the transport attributes to RequestInfo, which is
more clear to the implementers.

ATTR_SECURITY_LEVEL is moved to the internal GrpcAttributes and
annotated as TransportAttr, because transports are required to set it,
but no user is actually reading them from
{Client,Server}Call.getAttributes().

ATTR_AUTHORITY is removed, because no transport is overriding it.

All involved interfaces are changed to abstract classes, as this will
make further API changes smoother.

The CallCredentials name is stabilized, thus we first introduce
CallCredentials2, ask CallCredentials implementations to migrate to
it, while GRPC accepting both at the same time, then replace
CallCredentials with CallCredentials2.
2018-10-10 21:45:56 -07:00
Kun Zhang cc5e3c19df
core: ForwardingLoadBalancerHelper (#4911)
This will be used by LoadBalancer plugins that delegates to another,
which is what the new request routing (go/grpc-request-routing-design)
requires.  This will also be used to wrap LoadBalancers to add
client-side health-checking functionality.
2018-10-06 12:36:35 -07:00
Kun Zhang fbfc3a40d0
core: add Grpc.TRANSPORT_ATTR_LOCAL_ADDR (#4906)
Resolves #4135
2018-10-03 16:43:37 -07:00
Carl Mastrangelo 6b7fa40378
core: name anonymous classes in ManagedChannel for clear stacktraces 2018-10-03 14:09:00 -07:00
Kun Zhang ebbf8005be
doc: organize Attributes with annotations. (#4892)
* doc: organize Attributes Keys with annotations.

Keys are annotated with the following annotations:

1. Grpc.TransportAttr: transport attributes returned by
{Client,Server}Call.getAttributes().

2. NameResolver.ResolutionResultAttr: attributes passed as the
argument of NameResolver.Listener.onAddresses() and
LoadBalancer.handleResolvedAddressGroups()

3. EquivalentAddressGroup.Attr: attributes from
EquivalentAddressGroups.

* Expand the usage of annotations to Attributes variables.
2018-10-01 10:11:01 -07:00
zpencer 2fae9a3a97
core: permanently store authority at channel creation (#4886)
Getting the authority must not rely on the name resolver being
non-null, because that can trivially happen if the channel is shut
down.
2018-09-28 16:10:14 -07:00
Jesse Wilson 8b16899bc1 Upgrade to Guava 26.0-android and jsr305 3.0.2 2018-09-28 13:23:55 -07:00
zpencer da87ffb329
core,services: v1 binlog (#4846)
Log using new proto definition

- Remove io.grpc.BinaryLog.CallId because a call ID is now an AtomicLong
- Add the concept of "always included" and "never included" metadata
  keys. This is needed because grpc-status-details-bin is already
  logged in the binlog msg, and we will log grpc-trace-bin for the
  census info.
- unit tests are effectively rewritten
2018-09-27 13:19:24 -07:00
Spencer Fang cc09eab9af core: fix channelz import on AutoConfiguredLoadBalancerFactory
The original PR was stale when merged.
2018-09-19 14:32:16 -07:00
ZHANG Dapeng 0afc10c2d6
core: channel tracing to log lb policy changes 2018-09-19 11:36:33 -07:00
Carl Mastrangelo b0f423295b
all: use Java7 brackets 2018-09-14 13:52:29 -07:00
Nick Hill ed709ff9ff core: remove redundant SubchannelPicker refreshes in RoundRobinLoadBalancer
* Remove redundant SubchannelPicker refreshes in RoundRobinLoadBalancer

- Ensure active subchannel list and round-robin index is only
regenerated/refreshed when it changes
- Make it so that Subchannels exist in subchannels map iff their state
!= SHUTDOWN
- Add EmptyPicker class since logic for this case is disjoint from the
non-empty case

* remove explicit initialization of boolean ready field

per @carl-mastrangelo's review comment

* minor restructuring to make logic clearer; more explanatory comments

* move some checks inside updateBalancingState method for clarity

* store current state and picker in RRLB, only update when new one is diff

* some more simplification/refactoring; improve test coverage

- remove now redundant check in handleSubchannelState

- collapse getAggregatedState() and getAggregatedError() into
handleBalancingState()

- have both pickers extend new RoundRobinPicker, move
areEquivalentPickers() logic into RoundRobinPicker.isEquivalentTo()

- extend unit tests to cover some additional cases

* Address latest review comments from @zhangkun83

- Use explicit check for non-empty list instead of assert
- Change EmptyPicker.status to be non-nullable
- Further test coverage improvement including explicit picker comparison
tests

* use EMPTY_OK instead of Status.OK for initial empty picker
2018-09-12 15:06:46 -07:00
ZHANG Dapeng c8975e987b
all: fix lint warnings in import 2018-09-11 16:24:44 -07:00
zpencer 95fd47d747
core, services: remove census from binary logs (#4845)
The exact census span behavior wrt gRPC is not yet defined, so let's
punt on tight integration.

It may be fine to log grpc-trace-bin on server side because it is a
key visible to the application.
2018-09-10 16:35:08 -07:00
creamsoup 189991012b
core: DnsNameResolver caches refresh (#4812)
DnsNameResolver caches refresh using java security property networkaddress.cache.ttl.

Resolves #4745
2018-09-06 16:58:34 -07:00
zpencer 2fca42feb9
all: prepend internal classes with Internal (#4826)
This is a safer way to hide the classes, because they will not appear
in public targets for some build configurations.
2018-09-05 18:48:42 -07:00
zpencer 4d366ce978
all: move Channelz to io.grpc as InternalChannelz (#4797)
This is an API used to coordinate across packages and must live in
`io.grpc`.

Prepending `Internal` makes it easier to detect and hide this class
from public visibility when using certain build tools.

fixes #4796
2018-09-04 16:52:01 -07:00
creamsoup bbacd164f9
skip populating trace header if no census impl is available. (#4805) 2018-08-30 14:45:11 -07:00
ZHANG Dapeng 6037659dd7
core: make HedgingPolicy final
Just as RetryPolicy is final.
2018-08-28 17:09:05 -07:00
Eric Gribkoff 67ee4b6a8f
core: switch to Java 7 source and bytecode (#4801)
javac can produce code that invokes Object.requireNonNull when instantiating
an inner class using a instance variable. See
https://bugs.openjdk.java.net/browse/JDK-8202137
2018-08-27 20:48:57 -07:00
Kun Zhang 28d44ae46d
Start 1.16.0 development cycle (#4803) 2018-08-27 17:21:46 -07:00
Eric Anderson 7b126b00a0 all: Swap to Java 7 source and bytecode
Core and OkHttp are left with Java 6 for the moment. Once we resolve
their issues they could be bumped as well.

Updates #3961
2018-08-27 15:29:03 -07:00
ZHANG Dapeng e9b6568450
core: plumb hedging policy
This is only API plumbing for hedging, following exactly the same way as its retry counterpart, so it is almost trivial.
2018-08-23 14:38:10 -07:00
Carl Mastrangelo 3f05a6e331
core: minor cleanup of NameResolverProvider
* Make the list of providers an immutable List
* Make obvious that the list is statically initialized
* Add documentation for when methods were added.
* Use RuntimeException, rather than IllegalStateException.
2018-08-20 12:59:55 -07:00
Carl Mastrangelo 7fe49f9b52
core: add ability to create stackless status exceptions 2018-08-17 11:40:11 -07:00
zpencer a48b090dc6
core: Handle null ProxySelector (#4762)
ProxySelector.getDefault() can return null

Fixes #4677
2018-08-16 15:04:33 -07:00
creamsoup ba4db45e71 Fix errror message when DNS name is invalid. (#4751)
It used to throw NPE, since URI.create creates URI with null hostname. Now it
thorws IllegalArgumentException for invalid DNS name, NPE for null name.
2018-08-13 16:55:20 -07:00
Eric Anderson 3cfc5af4f1 core: Avoid implicit requestConnection in PickFirst
This makes the behavior more clear.
2018-08-13 09:41:06 -07:00
Spencer Fang 9f477b27bb core: fix unused variable lint 2018-08-09 13:31:23 -07:00
Eric Gribkoff 79b24709b9
all: update animalsniffer to Java 7 and add Android 14 (#4727) 2018-08-09 09:09:21 -07:00
Carl Mastrangelo 67352081f8
core: revert warning about `Status.asException(null)`
There seem to be some users converting from StatusRuntimeException
to StatusException using the following paradigm:

sre.getStatus().toException(sre.getTrailers())

Since there isn't a viable alternative, revert the warning.
2018-08-06 11:44:52 -07:00
Kun Zhang 2aa02fd869
core: remove unused fullMethodName field from CensusStatsModule. (#4731) 2018-08-03 09:16:29 -07:00
Carl Mastrangelo 9895e243b1
inprocess: prevent null names, and define socket address equality 2018-08-02 17:28:36 -07:00
Eric Anderson b64cde1488 Encourage using grpc-netty-shaded instead of grpc-netty
grpc-netty is still really useful, but for most users who aren't doing
anything advanced using grpc-netty-shaded is much safer from a
dependency basis.

grpc-netty-shaded has seen more usage and has shown itself to be stable
and reduce the number of conflicts due to Netty versions.
2018-08-02 16:58:59 -07:00
Tom Leach b9d1bb8b8b core: initialize round robin load balancer picker to random index (#4462)
RoundRobinLoadBalancerFactory creates a new Picker instance every time the set of provided address groups changes or the connection state of subchannels associated with existing address groups changes. In certain scenarios, such as deployment/replacement of the target service cluster, this can lead to high churn of Picker objects. Given that each new Picker's subchannel index is initialized to zero, in these scenarios requests can end up getting disproportionately routed through subchannels (and hence server nodes) which are earlier in the list of address groups.

At Netflix we have measured that some service nodes end up taking 3-4x the load that of other nodes during deployment.

This commit randomizes the start index of the RoundRobinLoadBalancerFactory.Picker which eliminates this behavior.
2018-08-01 13:15:17 -07:00
Carl Mastrangelo 85448189ee
all: add tracking issues for all experimental APIs and make it required
Additionally, make Status*Exception.getTrailers() non experimental
2018-07-31 15:28:48 -07:00
Carl Mastrangelo bcbc6ae8fd
core: stabilize Status Exceptions API, and warn on null trailers in Status 2018-07-27 15:53:44 -07:00
Carl Mastrangelo 9b200eb7be
core: add flags for selectively enabling grpclb 2018-07-27 15:24:43 -07:00
ZHANG Dapeng 658e73a69e
core: let channel tracing log service config changes
This is the implementation of the second one of the changes to the channel tracing spec
grpc/proposal#89
2018-07-25 10:42:00 -07:00
ZHANG Dapeng 03d85ee53e
doc: clarify channel state API unimplemented until v1.6.1
Resolves #4624
2018-07-24 14:01:24 -07:00
Carl Mastrangelo 8da06a8bc4
all: remove unneeded deps on errorprone 2018-07-23 17:51:44 -07:00
zpencer 67073c921e
core: turn PairSocketAddress into ProxySocketAddress (#4649)
This internal class will only ever be used to plumb proxy info.
2018-07-23 17:43:26 -07:00
George Gensure 19b2a17801 core: Don't close in TSREI in cancelled contexts (#4596)
Prevent multiple effective close calls either by successful completion
of a cancel or complete notification, or through successive exceptions
handled within a single call.
2018-07-23 14:39:39 -07:00
ZHANG Dapeng e1865b565d
core: channel tracing log only when number of backends changed between zeor and nonzero
This is to implement one of changes made in the spec
https://github.com/grpc/proposal/pull/89/files
2018-07-23 14:30:38 -07:00
Eric Gribkoff 877b1a198f
core: enterIdleMode() exits idle if still in use (#4630) 2018-07-23 09:45:06 -07:00
Carl Mastrangelo 64d272ae7c
core: make service config errors recoverable 2018-07-20 17:47:03 -07:00
Eric Anderson 15a5ba2698 Remove DoNotMock annotation in favor of JavaDoc
DoNotMock was removed from error_prone_annotations in 2.1.3, because
there was no enforcement mechanism (which is in google/error-prone#572).
Guava and Trust also depend on error_prone_annotations and are beginning
to use newer versions, so our usage of DoNotMock is causing diamond
dependency problems. This allows us to update to 2.2.0.

The annotations were useful internally; we're solving that in cl/205294089.
2018-07-20 14:03:55 -07:00
zpencer 4335445d98
Start 1.15.0 development cycle (#4650) 2018-07-18 10:48:04 -07:00
Carl Mastrangelo 146b6006b3
compiler,stub: update RpcMethod docs and usage 2018-07-12 17:01:47 -07:00
Eric Anderson 9222dc5d01 core: Add missing @Nullable annotations to ClientTransportOptions
Convert the checkNotNull into our more standard line while I'm cleaning
it up.
2018-07-09 17:21:51 -07:00
Eric Anderson 9d6241eedc Propagate EquivalentAddressGroup attributes to transports
Most of the changes are changing the signature of newClientTransport.
Since this is annoying, I choose to introduce a ClientTransportOptions
object to avoid the churn in the future.

With ClientTransportOptions in place, there's only a few lines necessary
of plumbing for the Attributes: add the field to ClientTransportOptions
and populate it in InternalSubchannel. There are no consumers of the
field in this commit.
2018-07-09 13:00:17 -07:00
Eric Anderson 2b48210b73 grpclb: Plumb attributes for OOB and backend channels
These attributes can be used by ALTS-specific code to determine whether
ALTS or TLS should be used.
2018-07-09 11:25:49 -07:00
Eric Anderson dd57b667cc
Fix unused variables
Unused variables in tests were deleted. The unused variable in Netty
was a future that needed completing; that was a bug.
2018-07-04 07:32:57 -07:00
Yang Song 02ad99e1f5 core: Avoid compare default TagContext in thread local with empty. (#4613) 2018-07-03 15:28:05 -07:00
ZHANG Dapeng 6dad047126
core: add jndi timeout and dirContext.close 2018-07-02 17:36:05 -07:00
Eric Anderson e3ff1ade07
core: Add support for List<EAG> in Subchannels
This avoids the needs to flatten to EAGs for cases like PickFirst,
making the Attributes in EAGs able to be used in communication with
core. See #4302 for some discussion on the topic.
2018-07-02 14:00:05 -07:00
Carl Mastrangelo 39d2dd0eaa
core: make InternalHandlerRegistry a HandlerRegistry 2018-06-29 13:01:25 -07:00
Nick Hill b2dd6ae7f0 util: Improve RoundRobinLoadBalancer scalability with stickiness
- Rework stickiness picker logic to be non-blocking
- Stash `Subchannel` ref in an attribute rather than dedicated map
2018-06-29 09:49:23 -07:00
Marco Ferrer ac55604527 fixed typo in round robin factory name const
Fixes: #4598
2018-06-29 09:16:30 -07:00
Eric Anderson 3e67a5be75 core: Avoid unnecessary unchecked cast in DnsNameResolver 2018-06-28 15:47:06 -07:00
Carl Mastrangelo a74bb350b7
core: always do SRV record lookup in DnsNameResolver
Instead of failing after a a missing A/AAAA record, this change
makes the resolver keep going and try out SRV records too.  This
is needed for use with ALTS, and is part of the gRPCLB spec.

This change also moved the JNDI code to a separate, reflectively
loaded file.  This makes it easy to exclude the file and not worry
about the missing class references on Android.  Additionally, if
javax.naming might be available on Android, this allows it to be
loaded.  A key side effect of this is that DnsNameResolver is
smaller, and more cleanly tested.
2018-06-26 16:15:52 -07:00
Carl Mastrangelo 81da3eb95b
core: make Auto config load balancer not depend on service config
Also, add some tests
2018-06-26 13:36:02 -07:00
Doug Lawrie ffd0f9feca inprocess: add a toString for InProcessSocketAddress
The motivation here is in some cases we log the remote-addr that is set in the gRPC call attributes, and have to special case this type to support inprocess servers.
2018-06-22 10:32:42 -07:00
Kun Zhang 15786520f9
grpclb: use exponential back-off for retries of balancer RPCs (#4525) 2018-06-12 14:04:45 -07:00
Grant Oakley defb955f3a core: add clarification to ClientCall javadoc
* Improve ClientCall documentation. Clarify that some methods of ClientCall may be invoked from any thread. Adds @throws clauses to request().
2018-06-12 10:23:01 -07:00