Age | Commit message (Collapse) | Author |
|
Update the Java gRPC implementation source to that of a released version
(v1.16.1) instead of some intermediate commit after v1.15.0.
Test: m grpc-java
Bug: 148404241
Change-Id: I9c072aee054a4aecc1bdf39adf45e9a243b907f5
|
|
Build the library from source since the imported prebuilts are
inconsistent and incomplete. For starters, the source is that of version
1.15.0 but the imported jars are those of version 1.14.0.
More importantly the grpc-java-protobuf library depends on the
grpc-java-protobuf-lite library that is not prebuilt. This causes
runtime errors due to missing symbols that should have been caught at
compile-time.
The Soong build modules follow the upstream Bazel rules as closely as
possible. Note that some static libraries were added to the grpc-java to
maintain compatibility with other rules that depend on it since the
original prebuilt grpc-java-core jar contained all sources under core/
which is not how the library is built using Bazel.
Test: m grpc-java
Test: Diffed the entries between the old and new jars
Bug: 148404241
Change-Id: I060333a68848272d5d9e09c040c1e35451a408c6
|
|
|
|
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
|
|
|
|
|
|
This reverts commit 189991012bbff42b975c51045c32efceaa07f462.
|
|
Test: make grpc-java
Bug: None
Change-Id: I55dc3d537c87c7ffc80b23cdec48fa830e9c87db
|
|
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.
|
|
Also annotate NameResolver.Listener as experimental because
annotations of an outer class don't show in the javadoc page of its
inner classes.
|
|
Backport of #4953
Updates #4951
|
|
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.
|
|
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.
|
|
Resolves #4135
|
|
|
|
Add basic build files for the grpc-java modules.
Still need to be added: netty, protobuf
Test: make
Bug: None
Change-Id: I9248dd23c0ec24ec0f9a15aa6f6d826b7b90d617
|
|
* 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.
|
|
Getting the authority must not rely on the name resolver being
non-null, because that can trivially happen if the channel is shut
down.
|
|
|
|
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
|
|
The original PR was stale when merged.
|
|
|
|
|
|
* 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
|
|
|
|
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.
|
|
DnsNameResolver caches refresh using java security property networkaddress.cache.ttl.
Resolves #4745
|
|
This is a safer way to hide the classes, because they will not appear
in public targets for some build configurations.
|
|
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
|
|
|
|
Just as RetryPolicy is final.
|
|
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
|
|
|
|
Core and OkHttp are left with Java 6 for the moment. Once we resolve
their issues they could be bumped as well.
Updates #3961
|
|
This is only API plumbing for hedging, following exactly the same way as its retry counterpart, so it is almost trivial.
|
|
* 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.
|
|
|
|
ProxySelector.getDefault() can return null
Fixes #4677
|
|
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.
|
|
This makes the behavior more clear.
|
|
|
|
|
|
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.
|
|
|
|
|
|
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.
|
|
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.
|
|
Additionally, make Status*Exception.getTrailers() non experimental
|
|
|
|
|