Commit Graph

488 Commits

Author SHA1 Message Date
yifeizhuang ecb2210cc1
interop-test: test_orca_oob add retry limit 5 (#9251) 2022-06-07 15:11:47 -07:00
yifeizhuang c48b01a46c
interop-test:sync grpc-proto and fix typo (#9233) 2022-06-03 09:31:32 -07:00
yifeizhuang 3624d59b18
interop-test: orca test change gradle dependency to xds non-shaded to allow bazel run (#9230)
Co-authored-by: Eric Anderson <ejona@google.com>
2022-06-03 09:31:00 -07:00
apolcyn 6dbd1d8f58
interop-testing: bump client op timeout from 5 to 15 seconds (#9211)
JVM startup costs that happen when dependencies are loaded for the
first time can consume a lot of time (we've occasionally observed
around ~5 seconds of CPU time); this causes frequent test flakes
with xds (google-c2p) when using the current 5 second deadline.
Increasing to 15 seconds should give enough time.
2022-05-27 14:36:54 -07:00
Terry Wilson fc406e8612
xds: Properly assign picker. (#9201)
* xds: Properly assign picker.

Fixes a bug where the picker was not getting used in RpcBehaviorLoadBalancer.
2022-05-25 12:40:12 -07:00
yifeizhuang 01ab821a06
interop-test: add orca test case (#9079)
add interop testing `orca_per_rpc` and `orca_oob`
2022-05-24 13:34:01 -07:00
Terry Wilson 62119b2a2e
interop-testing: Update comment to round_robin. (#9196) 2022-05-24 10:45:07 -07:00
Terry Wilson 4a5f6adf73
interop-testing: LB that adds the rpc-behavior to calls (#9186) 2022-05-20 12:17:58 -07:00
Eric Anderson 5bb721e217
interop-testing: Support syncing protos from grpc-proto
Two main incompatibilities existed in the copy of protos in grpc-proto:
no SimpleContext and an Empty method argument was replaced with a
message. "Context" is a very old word for "Metadata" back from the days
before the current gRPC protocol. We don't need that message in
particular, and well-known protos actually works in Protobuf Lite these
days, so we can swap to wrappers.proto's StringValue and don't need to
upstream a change to grpc-proto. The argument problem is fixed just by
changing the type in the Java code.

With the incompatibilities fixed, do a sync from grpc-proto and include
interop-testing.
2022-05-18 14:28:20 -07:00
Michael Lumish 78067cbace
xds: Update rpc-behavior handling in interop server 2022-05-16 10:07:22 -07:00
DNVindhya 15ecc0714e
gcp-observability: add grpc-census as a dependency and update opencensus version (#9140) 2022-05-03 20:52:34 -07:00
Ran e258fc743b
Use `ImmutableMap.Builder.buildOrThrow()` instead of deprecated `build()`. (#9132) 2022-05-02 11:51:42 -07:00
Eric Anderson 812264ef87
interop-testing: Improve ConcurrencyTest error reporting
When a problem happens, it will now report back quickly instead of
waiting until the timeout expires. The timeout exception will also
report each RPC's state.

This is to help diagnose aarch64 test failures.
2022-05-02 10:10:42 -07:00
Eric Anderson 369f87becd Revert "auth: Add support for Retryable interface"
This reverts commit 0963f3151d. This
causes dependency problems when importing into Google, as
google-auth-library-java needs to be upgraded and that requires an
upgrade to google-http-java-client to bring in
https://github.com/googleapis/google-http-java-client/pull/1505 .
Reverting for now and will roll forward once those upgrades are
performed.
2022-04-27 15:38:13 -07:00
Eric Anderson 0963f3151d
auth: Add support for Retryable interface
Retryable was added in google-auth-library 1.5.3 to make clear the
situations that deserve a retry of the RPC. Bump to that version and
swap away from the imprecise IOException heuristic.
go/auth-correct-retry

Fixes #6808
2022-04-26 08:59:08 -07:00
Mohan Li 5b321c6096
interop-testing: register RLS 2022-04-04 12:20:31 -07:00
beatrausch b20ce17817
okhttp: make okhttp dependencies compile only (#8971)
* okhttp: forked required files to make okhttp dep compile only

* okhttp: forked missing file to make okhttp dep compile only

* okhttp: moved url and request files to proxy packge

* okhttp: removed unused methods from forked files; fixed build
2022-03-30 13:43:30 -07:00
apolcyn 04c2b190c0
Simplify fallback test client and parameterize fallback deadline (#8989) 2022-03-21 10:03:48 -07:00
apolcyn 42b32c64f5
interop-testing: Add a configurable warmup phase to fallback test client 2022-03-04 12:18:07 -08:00
ZHANG Dapeng 431fb0255f
core/netty: infinite local-only transparent retry for netty (#8878)
In core, add a new enum element to `RpcProgress` for the case that the stream is closed even before anything leaves the client. `RetriableStream` will do unlimited transparent retry for this type of `RpcProgress` since they are local-only.

In netty, call `tranportReportStatus()` for pending streams on failure.

Also fixes #8394
2022-02-04 22:12:03 -08:00
Penn (Dapeng) Zhang 3179bc3be0 Revert "use charset from StandardCharsets instead of 'Charset.forName' (#8779)"
This reverts commit a74a3ad834.
2022-01-18 10:14:50 -08:00
Eric Anderson 58a7ace6ac
Bump ErrorProne to 2.10.0
Previous versions of error prone were incompatible with Java 17 javac.

In grpc-api, errorprone is now api dependency because it is on a public
API.  I was happy to see that Gradle failed the build without the dep
change, although the error message wasn't super clear as to the cause.

It seems that previously -PerrorProne=false did nothing. I'm guessing
this is due to a behavior change of Gradle at some point. Swapping to
using the project does build without errorProne, although the build
fails with Javac complaining certain classes are unavailable. It's
unclear why. It doesn't seem to be caused by the error-prone plugin.
I've left it failing as a pre-existing issue.

ClientCalls/ServerCalls had Deprecated removed from some methods because
they were only deprecated in the internal class, not the API. And with
Deprecated, InlineMeSuggester complained.

I'm finding InlineMeSuggester to be overzealous, complaining about
package-private methods. In time we may figure out how to use it better,
or we may request changes to the checker in error-prone.
2022-01-12 12:06:27 -08:00
Eric Anderson 69671e152f
interop-testing: Fix script rewrite for Gradle 7.2
e0dca93c broke the interop-testing script for unix because Gradle
changed the scripts for
https://github.com/gradle/gradle/security/advisories/GHSA-6j2p-252f-7mw8

The solution here looks weird, but we are inserting the replacement
string into a single-quoted string, so we stop that string, start a
double-quoted string to allow the variable replacement, and then resume
the previous string.
2022-01-11 09:43:41 -08:00
Jintao a74a3ad834
use charset from StandardCharsets instead of 'Charset.forName' (#8779)
Co-authored-by: Penn (Dapeng) Zhang <zdapeng@google.com>
2022-01-07 15:03:14 -08:00
Eric Anderson d44de5069d
Bump to Gradle 6.9 and update plugins
These changes make the build compatible with Gradle 7, except for
Android which requires plugin updates.

I removed animalsniffer from binder because it did nothing (as there
were no signatures) and it was failing after setting toolVersion. It
failed because animalsniffer is only compatible with java plugin. After
this change I put the withId(animalsniffer) loading inside the
withId(java) to avoid a plugin ordering failure. That made it safe again
for binder to load animalsniffer, but it is still best to remove the
plugin from binder as it is misleading.

I did not upgrade Android plugin versions as newer versions (even 3.6)
require dealing with androidx (#8421).
2022-01-07 09:54:50 -08:00
Mohan Li b244ba8d4c
xds: add skipNetCmd flag to fallback test client (#8765)
We are setting up fallback test based on TD. Currently the test client is compiled in google3, so we must run it in a container so that the client can have the GRTE dependency. However, container does not have `ip`, `iptables`, etc network command, so we plan to run the network command outside of the container. To do this, add a new flag `skipNetCmd` to skip network commands inside the test client.
2021-12-20 13:00:42 -08:00
ZHANG Dapeng 042f9879d4
all: remove deprecated StreamInfo.transportAttrs (#8768)
APIs such as `StreamInfo.getTransportAttrs()` were [deprecated](860e97d12a (diff-aa4049f54d6d5d462700e9221344184a37d2068b3ba7d715abd417b1df5bf883R114)) since 1.41.0. Removing now.
2021-12-20 09:46:25 -08:00
sanjaypujare c0b8eff984
interop-testing: assign server as soon as it is built instead of after start (#8662) 2021-11-04 12:31:11 -07:00
yifeizhuang 93a77a78a9
Revert "xds: add xds end to end interop test (#8618)" (#8656)
This reverts commit 0000cba665.
2021-11-03 12:13:05 -07:00
yifeizhuang 0000cba665
xds: add xds end to end interop test (#8618)
Add AbstractXdsInteropTest, XdsTestControlPlaneService and only ping-pong testcase in initial implementation.
AbstractXdsInteropTest sets up the test control plane, create xdsClient and xdServer using bootstrap override, test case extending AbstractXdsInteropTest is supposed to override the control plane config and run the verification.

XdsTestControlPlaneService only has static xds configurations, not able to keep states.

How to run:
 ./gradlew :grpc-interop-testing:installDist -PskipCodegen=true
 ./interop-testing/build/install/grpc-interop-testing/bin/xds-e2e-test-client
2021-11-02 13:20:41 -07:00
ZHANG Dapeng 7c6f53ab79
all: add internal API to disable retry stats (#8510)
Resolves b/197648853 for internal performance regression. Reporting retry stats caused significant amount of performance overhead internally.
2021-09-13 09:12:04 -07:00
ZHANG Dapeng 2faa748797
census: Fix retry stats data race (#8459)
There is data race in `CensusStatsModule. CallAttemptsTracerFactory`:

If client call is cancelled while an active stream on the transport is not committed, then a [noop substream](https://github.com/grpc/grpc-java/blob/v1.40.0/core/src/main/java/io/grpc/internal/RetriableStream.java#L486) will be committed and the active stream will be cancelled. Because the active stream cancellation triggers the stream listener closed() on the _transport_ thread, the closed() method can be invoked concurrently with the call listener onClose(). Therefore, one `CallAttemptsTracerFactory.attemptEnded()` can be called concurrently with `CallAttemptsTracerFactory.callEnded()`, and there could be data race on RETRY_DELAY_PER_CALL. See also the regression test added.

The same data race can happen in hedging case when one of hedges is committed and completes the call, other uncommitted hedges would cancel themselves and trigger their stream listeners closed() on the transport_thread concurrently. 

Fixing the race by recording RETRY_DELAY_PER_CALL once both the conditions are met: 
- callEnded is true 
- number of active streams is 0.
2021-09-02 10:24:22 -07:00
apolcyn 137bdaa868
interop-testing: add soak test cases to test service client 2021-08-27 15:30:43 -07:00
ZHANG Dapeng 29172a9665
interop-testing: fix misleading log message (#8426)
`logger.log(Level.WARNING, "Rpc failed: {0}", t)` will just print a literal "Rpc failed: {0}" followed by exception details.
2021-08-20 11:02:03 -07:00
ZHANG Dapeng fd2a58a55e
all: implement retry stats (#8362) 2021-08-11 10:24:37 -07:00
Eric Anderson 20ac1999d4
stub: Mark Stub-based MetadataUtils methods deprecated
We don't want other APIs to copy the stub-based API to attach the
interceptor. The API has a shorter name, but isn't actually all that
easier to use and isn't fluent like using the interceptor API.

These are _very_ old methods, so we won't be quick to delete them. Seems
we should have them deprecated at least a year or two; they are easy to
maintain in the mean time.

See API Review notes in #1789
2021-08-06 14:14:17 -07:00
ZHANG Dapeng 860e97d12a
all: API refactoring in preparation to support retry stats (#8355)
Rebased PR #8343 into the first commit of this PR, then (the 2nd commit) reverted the part for metric recording of retry attempts. The PR as a whole is mechanical refactoring. No behavior change (except that some of the old code path when tracer is created is moved into the new method `streamCreated()`).

The API change is documented in go/grpc-stats-api-change-for-retry-java
2021-07-31 18:33:02 -07:00
ZHANG Dapeng d836f38979
core: add real transport test for retry buffer limit (#8354)
The unit tests in RetriableStreamTest do not really test buffer limit from end to end, because the buffer limit is implemented using ClientStreamTracer.Factory, and the tracer callback outboundMessageSize() is only triggered in AbstractClientStream after message serialization. In fact, it was broken without failing any existing tests (#8343 (comment))

This PR adds a retry buffer limit test that runs through the AbstractClientStream code path.
2021-07-28 18:59:50 -07:00
ZHANG Dapeng 438f8d9e78
interop-testing: extend XdsTestServer features to support retry test
Extend XdsTestServer features as specified in go/xds-retry-interop-test

See also xds retry interop test case implementation grpc/grpc#26746, grpc/grpc#26791

Previously, rpc-behavior values in the request headers are handled in tow different places, one in interceptor and the other in service implementation via Context. I moved all the rpc-behavior handling in interceptor, Context is not needed any more.
2021-07-26 12:04:58 -07:00
Eric Anderson 0cabf5672a compiler: Add GrpcGenerated annotation to generated class
This can be used by annotation processors to avoid processing the
gRPC-generated code. The normal Generated annotation only has SOURCE
retention, so isn't available to annotation processors.

I don't include the service name within the annotation as that assumes
we'll never have need for any other type of generated class. If there's
a request for exposing service name via an annotation in the future, we
can make an RpcService annotation or the like.

Fixes #8158
2021-07-02 22:11:40 -07:00
Eric Anderson 6201db2d96 Fix aarch64 emulation-triggered flakes
Because we are emulating aarch64 during testing the tests run slower
than normal. Bumping the timeout seems easy and obvious for
StressTestClientTest. The warmup for BinlogHelperTest mirrors what we've
done with timing-based tests in the past. Hopefully that is enough to
lower variance so that it passes consistently; seems likely. I'd rather
not increase the timing fuzziness if I can avoid it, as that reduces the
test's ability to detect issues.

Fixes #8135 (mostly+hopefully)
2021-06-17 13:32:11 -07:00
Eric Anderson 5642e01243
Replace failOnVersionConflict() with custom requireUpperBoundDeps
failOnVersionConflict has never been good for us. It is equivalent to
Maven dependencyConvergence which we discourage our users to use because
it is too tempermental and _creates_ version skew issues over time.
However, we had no real alternative for determining if our deps would be
misinterpeted by Maven.

failOnVersionConflict has been a constant drain and makes it really hard
to do seemingly-trivial upgrades. As evidenced by protobuf/build.gradle
in this change, it also caused _us_ to introduce a version downgrade.

This introduces our own custom requireUpperBoundDeps implementation so
that we can get back to simple dependency upgrades _and_ increase our
confidence in a consistent dependency tree.
2021-06-11 14:01:18 -07:00
Chengyuan Zhang bab1fe38dc
services: move classes with protobuf dependency into io.grpc.protobuf.services (#8056)
To separately manage services/classes with and without protobuf dependency in services package, we are moving classes with protobuf dependency into io.grpc.protobuf.services. This includes healthchecking, reflection, channelz, and binlogging.

Forwarding classes are created to avoid breaking existing users, while they are marked as deprecated to notify users to migrate.
2021-04-16 17:27:12 -07:00
Sergii Tkachenko 11c3667b8c interop-testing: xDS interop app uses AdminInterface 2021-03-30 21:23:19 -04:00
apolcyn ab216a1720
interop-testing, xds: Allow using TestServiceClient for making Traffic Director RPCs (#7994)
Updates TestServiceClient to support creating channel without target port (mostly useful for xDS that uses the channel target as the resource name).

Adds an env var for overriding the TD URI used in cloud-to-prod test.
2021-03-19 12:44:52 -07:00
Eric Anderson c26ee03cd9 netty: Add Http2Headers.setLong() for inbound headers
Starting in Netty 4.1.60, Netty will validate Content-Length headers
using getAll() and setLong(). While getAll() was documented as only used
in tests, it doesn't appear it was currently used in any tests.

While Http2NettyTest.contentLengthPermitted() was added to confirm that
Content-Length works, it won't actually exercise any interesting
behavior until we upgrade to Netty 4.1.60. However, I did test with
Netty 4.1.60 and it reproduced the failure in
https://github.com/grpc/grpc-java/issues/7953 and passed with this
change.

Since Netty is now observing/modifying the headers, it would seem
appropriate to implement a substantial portion of the Http2Headers API.
However, the surface is much larger than we'd want to implement for a
'quick fix' that could be backported. In addition, it seems much of the
API is just convenience methods, so it is probably appropriate to split
out a AbstractHeaders class from DefaultHeaders in Netty that doesn't
make any assumptions about the header storage mechanism.
2021-03-16 16:36:18 -07:00
apolcyn 972fda2cd7
Add a flag to interop clients to allow statically configuring grpclb (#7957) 2021-03-11 10:55:18 -08:00
Eric Anderson a55e034732 interop-testing: Specify ca-cert with transport-agnostic Credentials API 2021-02-19 09:30:24 -08:00
Eric Anderson 2e0e238fb2 okhttp: Consume mTLS and Trust/KeyManager Credentials API 2021-02-19 09:30:24 -08:00
Eric Anderson 0eab1c9176 netty: Consume mTLS and Trust/KeyManager Credentials API 2021-02-19 09:30:24 -08:00