Commit Graph

4226 Commits

Author SHA1 Message Date
Chengyuan Zhang a86fc47c04
xds: change route data validation logic (#7047)
Changed the logic of parsing Route to skip Routes with action that specifies cluster_header. Eliminate unnecessary validation logic in XdsClientImpl, of which is already covered in converters.
2020-05-18 16:23:25 -07:00
Chengyuan Zhang 02e3c00c39
xds: add more route matching types in converted Route data structure (#7031)
Parse other matcher types (e.g., header matchers, runtime fraction matchers, etc) that xDS Route supports.
2020-05-18 11:47:37 -07:00
sanjaypujare efa9cf6798
xds: provide fallback protocol negotiator (#7040) 2020-05-18 10:30:13 -07:00
AgentK d89dd2db33
netty: log SocketExceptions at FINE, too
This PR changes the `NettyServerTransport#getLogLevel` method to log 
`SocketException`s to `LogLevel.FINE`, rather than exclusively pure
IOExceptions. This may fix an unintentional regression introduced in
c166ec2c, although the message in my java version (14.0.1) wouldn't have
passed the old logic for quieting either. This also fixes the issue
raised in #6423 that was locked for inactivity.

This fixes 
```
[2020/05/14 20:21:52   INFO] [io.grpc.netty.NettyServerTransport.connections] Transport failed
java.net.SocketException: Connection reset
        at java.base/sun.nio.ch.SocketChannelImpl.throwConnectionReset(SocketChannelImpl.java:345)
        at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:376)
        at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:288)
        at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1125)
        at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:347)
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148)
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:677)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:612)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:529)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:491)
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:905)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.base/java.lang.Thread.run(Thread.java:832)
```
being logged to level INFO, which occurs whenever a socket is improperly 
closed by the client, such as with the grpc-health-probe (They've got an
[open issue](https://github.com/grpc-ecosystem/grpc-health-probe/issues/34)
for this)
2020-05-15 15:31:35 -07:00
Jihun Cho 4a80b42118
rls: update proto (#7046) 2020-05-15 12:27:05 -07:00
Ran c5740f893c
Stub: add an util method for setting StubType. (#7045) 2020-05-15 11:45:17 -07:00
Jongho Jeon 6b9cd6d6ed
grpc-context: name Context#key(name) parameter more clearly
Motivated by #7024
2020-05-13 13:35:17 -07:00
Philippe Laflamme cc2d376a93
interop-testing: adds assertions to empty_stream test case (#7030)
If the server fails (e.g.: with an unimplemented status), the test still succeeds.
This change adds assertions to check the status code as well as the expected number of responses.
2020-05-12 17:44:09 -07:00
ZHANG Dapeng f9353e09c5
xds: fix lint 2020-05-12 16:51:24 -07:00
Eric Anderson b1ca6e8d27 Automate release process for example-hostname 2020-05-12 14:30:27 -07:00
Jihun Cho 1c50bcafd5
netty: enable auto flow control tuning by default (#7015) 2020-05-11 16:38:58 -07:00
ZHANG Dapeng 7b3b9a2fdb
grpc-all: use api configuration for dependencies
Use `api` configuration instead of `implementation` for grpc-all to avoid breaking users.
2020-05-11 09:48:33 -07:00
ZHANG Dapeng 61938bd032
xds: rename experimental routing flag to GRPC_XDS_EXPERIMENTAL_ROUTING 2020-05-08 16:15:12 -07:00
Kun Zhang 96a32ed768
core/doc: clarify when ClientCall.cancel() can be called.
The original javadoc may be misunderstood as "one must call
halfClose() before calling cancel()".
2020-05-07 18:41:22 -07:00
Jihun Cho e7d6b5f808
rls: add bazel build (#7019) 2020-05-07 17:59:47 -07:00
sanjaypujare 67cc3172f1
xds: replace deprecated fields for Upstream and Downstream TlsContext (#7010) 2020-05-07 16:01:04 -07:00
Jihun Cho 6cde3b220b
all: fix lint warnings (#7016) 2020-05-07 15:43:53 -07:00
Eric Anderson 29725bb298 README.md: Include annotations api dep in code snippets
We include this dep in our examples, but never mentioned it in the README.
Instead of getting into details about what it's for, the brief comment should
avoid most confusion for existing Java 8 users about why it appears to be
unnecessary.
2020-05-07 15:13:02 -07:00
Jihun Cho 190ab88400
examples: update xds example readme (#7017) 2020-05-07 13:24:30 -07:00
Jihun Cho 24823c741f
stub: default impl for disableAutoRequestWithInitial(int) (#7018) 2020-05-07 12:47:28 -07:00
Jihun Cho 73d35e336e
rls: add internal api to provide default cachnig client builder for testing (#7014) 2020-05-06 14:11:22 -07:00
Jihun Cho e62148f85d
rls: remove internal package (#7013) 2020-05-06 11:21:21 -07:00
Reginald McDonald 16b6145064
inprocess,core: add ability to pass status cause to client
Closes #5439
2020-05-06 11:08:15 -07:00
DRayX a9250c1f99
stub: Add disableAutoRequestWithInitial that disables all automatic inbound flow-control requests
Add a new disableAutoRequest method that disables all automatic requests while disableAutoInboundFlowControl maintains existing behavior.

The default behavior of requesting initial messages is applied even if disableAutoInboundFlowControl is called. ServerCalls disables all automatic flow control which is much more useful in case the user can't handle incoming messages until some time after the call has started.  This change creates a new StartableListener that has an onStart method that is invoked when the call is started which makes initial requests if necessary.

See #6806
2020-05-06 10:19:41 -07:00
Jihun Cho 0057c4f29d
rls: temporarily disable lb test until fixed (#7011) 2020-05-05 18:05:23 -07:00
Jihun Cho 86fc047966
rls: add internal package description (#7009) 2020-05-05 17:06:12 -07:00
apolcyn 79b00d266e
interop testing: add a gRPCLB fallback test client
This is a java analogue of the C++ test added in grpc/grpc#19623.

Proto changes were synced from grpc/grpc-proto

This client is suitable for testing fallback with any "grpclb" load-balanced service, but is particularly meant to implement a set of test cases described in an internal doc titled "DirectPath Cloud-to-Prod End-to-End Test Cases", section "gRPC DirectPath-to-CFE fallback".
2020-05-05 14:22:25 -07:00
Jihun Cho 8b914ee114
rls: add guava dependency (#7008) 2020-05-05 13:53:08 -07:00
Jihun Cho 8e8477704a
rls: generate rls coverage (#7004) 2020-05-05 10:11:33 -07:00
Jihun Cho 0515b8bed3
rls: fix resize, add some tests (#7005) 2020-05-05 10:11:12 -07:00
Jihun Cho f40af886e9
rls: add rls-exprimnetal LoadBalancer (#6998) 2020-05-04 18:05:19 -07:00
Jihun Cho 29a872e173
xds: import fault injection xds proto (#7003) 2020-05-04 16:51:33 -07:00
ZHANG Dapeng 0044f8ce56
all: migrate gradle build to java-library plugin
- Use gradle configuration `api` for dependencies that are part of grpc public api signatures.
- Replace deprecated gradle configurations `compile`, `testCompile`, `runtime` and `testRuntime`.
- With minimal change in dependencies: If we need dep X and Y to compile our code, and if X transitively depends on Y, then our build would still pass even if we only include X as `compile`/`implementation` dependency for our project. Ideally we should include both X and Y explicitly as `implementation` dependency for our project, but in this PR we don't add the missing Y if it is previously missing.
2020-05-04 16:44:30 -07:00
RiyaTyagi 20f712c14a
benckmarks: integrated the two README.md
The readme file present at "benchmarks/src/jmh/java/io/grpc/benchmarks/netty/README.md" is integrated with readme at "benchmarks/README.md".
2020-05-04 15:43:56 -07:00
sanjaypujare 1b792d1ccf
xds: create XdsServer wrapper for correct start and shutdown semantics (#6978) 2020-05-04 10:02:42 -07:00
ZHANG Dapeng ce9d217920
all: introduce gradle util functions to manage guava dependency
Define util function to exclude guava's transitive dependencies jsr305 and animal-sniffer-annotations, and always manually add them as runtimeOnly dependency. error_prone_annotations is an exception: It is also excluded but manually added not as runtimeOnly. It must always compile with guava, otherwise users will see warning spams if guava is in the compile classpath but error_prone_annotations is not.
2020-05-01 22:59:28 -07:00
ZHANG Dapeng 9520dc4c45
build.gradle: apply resolution strategy for runtimeClasspath 2020-05-01 22:59:06 -07:00
Jihun Cho 83a3b25e80
netty: allow to use bandwidth delay product (#6979) 2020-05-01 15:39:22 -07:00
Jihun Cho 50a829ad9d
rls: caching rls client (#6966) 2020-05-01 12:02:05 -07:00
Chengyuan Zhang a423900491
api, core, services: make ProtoReflectionService interceptor compatible (#6967)
Eliminate the hack of InternalNotifyOnBuild mechanism for letting ProtoReflectionService get access to the Sever instance, which makes ProtoReflectionService incompatible with server interceptors. This change put the Server instance into the Context and let the ProtoReflectionService RPC obtain it in its RPC Context. Also enhanced ProtoReflectionService so that one service instance can be used across multiple servers.
2020-05-01 10:39:38 -07:00
Eric Anderson 4674b27736 api,stub: Improve waitForReady documentation 2020-04-30 16:03:52 -07:00
Chengyuan Zhang c6251cf085
xds: add onResourceDoesNotExist API for resource watchers (#6988)
Use onResourceDoesNotExist() API for notifying resource not found. Previously, it uses onError(), which mixes with errors for other failures (e.g., transient TD network error). This lets us be able to make further improvement of LB policies/resolver's behavior w.r.t control plane changes (e.g., should immediately go into TRANSIENT_FAILURE if the config received from control plane leads to it).
2020-04-30 13:30:49 -07:00
Eric Anderson 6a50a63ca8 Replace javax.annotation-api with Tomcat's annotations-api
javax.annotation-api is licensed CDDL, which was not noticed when it was
introduced. Tomcat provides an Apache 2 version of the same annotation. Note
that this annotation is only used when compiling with Java 9+.

Unfortunately this may cause classpath collisions since there are _many_ copies
of this annotation on Maven Central; we wanted one canonical source and
javax.annotation-api seemed like that source. We hope this won't impact many
users since we have always suggested using it only for compilation. But it will
probably impact some users. However, we didn't create this mess, this seems to
be "standard practice" for J2EE, which this annotation is now part of, so we're
just impacted by it.

Fixes #6833
2020-04-30 09:14:32 -07:00
ZHANG Dapeng e78d1c95ef
core: support default method config in service config (#6987)
References:
service config spec change: grpc/grpc-proto#75
c-core implementation grpc/grpc#22232
2020-04-29 13:53:53 -07:00
Jihun Cho d605faafc3
README.md: fix version typo (#6976) 2020-04-24 09:53:56 -07:00
Eric Gribkoff 95b0550c59
buildscripts: use xds-test-server image (#6889) 2020-04-23 15:59:19 -07:00
Patrice Chalin d097cc0ee0
RouteGuideClient example: use E7 format for latitude & longitude
As indicated in the proto file, point coordinates are in degrees encoded in E7 format.
https://github.com/grpc/grpc-java/blob/master/examples/src/main/proto/route_guide.proto#L54
2020-04-23 13:21:45 -07:00
ZHANG Dapeng 88bd7278ae
xds: reject case-insensitive route match 2020-04-22 17:10:30 -07:00
Jihun Cho 4a644cb876
rls: fake direct scheduled executor supports schedule (#6957) 2020-04-22 12:04:26 -07:00
Chengyuan Zhang e089ceaadc
SECURITY.md: add instruction for disabling Conscrypt's default TrustManager (#6962) 2020-04-22 11:28:24 -07:00