Commit Graph

515 Commits

Author SHA1 Message Date
Eric Anderson d17a2db4bd Upgrade to Checkstyle 8.28
Trying to upgrade Gradle to 7.6 improved the checkstyle plugin such that
it appears to have been running in new occasions. That in turn exposed
us to https://github.com/checkstyle/checkstyle/issues/5088. That bug was
fixed in 8.28, which also fixed lots of other bugs. So now we have
better checking and some existing volations needed fixing. Since the
code style fixes generated a lot of noise, this is a pre-fix to reduce
the size of a Gradle upgrade.

I did not upgrade past 8.28 because at some point some other bugs were
introduced, in particular with the Indentation module. I chose the
oldest version that had the particular bug impacting me fixed. Upgrading
to this old-but-newer version still makes it easier to upgrade to a
newer version in the future.
2023-01-05 17:07:04 -08:00
Larry Safran c145473756
Improve error message when deadline is exceeded, making it clear which deadline (Context or CallOptions) was exceeded and making the grammar clearer. (#9713) 2022-11-30 13:58:57 -08:00
yifeizhuang b593871801
core: fix RejectedExecutionException in Retriable Stream (#9626)
Add big negative integer to pending stream count when cancelled. The count is used to delay closing master listener until streams fully drained.
Increment pending stream count before creating one. The count is also used to indicate callExecutor is safe to be used. New stream will not be created if big negative number was added, i.e. stream cancelled. New stream is created if not cancelled, callExecutor is safe to be used, because cancel will be delayed.
Create new streams (retry, hedging) is moved to the main thread, before callExecutor calls drain.
Minor refactor the masterListener.close() scenario.
2022-11-22 13:04:06 -08:00
Eric Anderson bacf18db8d
census: Avoid deprecated measure constants
Many of the deprecated constants are just aliases for non-deprecated
constants, so just swap which one we use.
2022-09-12 08:19:21 -07:00
Larry Safran b66250e9e5
Rls spec sync (#9437)
rls: Update implementation to match spec.

* Cleanup cache if exceeds max size when add an entry. Make cache entry size calculations more accurate
* Trigger pending RPC processing if unexpired backoff entries were removed from the cache by triggering helper to call it's parent updateBalancingState with the same state and picker
* Introduce minimum time before eviction (5 seconds)
* Change default accept ratio for AdaptiveThrottler from 1.2 -> 2.0
* Configuration validation
* When checking key names for duplicates also look at headers
* Check extra keys for duplicates

See analysis of implementation versus spec at https://docs.google.com/spreadsheets/d/18w5s1TEebRumWzk1pvWnjiHFGKc6MW-vt8tRLY4eNs0/
2022-08-19 13:31:05 -07:00
Eric Anderson 61f19d707a
Swap Animalsniffer to Java 8 and Android 19
Also added missing signatures. Swapping to version catalog will make
this process easier in the future.
2022-08-10 12:41:57 -07:00
Terry Wilson 7665d3850b
Revert "Add LoadBalancer.acceptResolvedAddresses() (#8742)" (#9414)
This reverts commit 70a29fbfe3.
2022-07-28 12:15:26 -07:00
Terry Wilson 70a29fbfe3
Add LoadBalancer.acceptResolvedAddresses() (#8742)
Introduces a new acceptResolvedAddresses() to the LoadBalancer.

This will now be the preferred way to handle addresses from the NameResolver. The existing handleResolvedAddresses() will eventually be deprecated.

The new method returns a boolean based on the LoadBalancers ability to use the provided addresses. If it does not accept them, false is returned. LoadBalancer implementations using the new method should no longer implement the canHandleEmptyAddressListFromNameResolution(), which will eventually be removed, along with handleResolvedAddresses().

Backward compatibility will be maintained so existing load balancers using handleResolvedAddresses() will continue to work.

Additionally the previously deprecated handleResolvedAddressGroups() method is removed.
2022-07-26 09:23:37 -07:00
yifeizhuang 5f1a1d4f35
service: CalMetricRecorder.recordCallMetric is deprecated, use CalMetricRecorder.recordRequestCostMetric (#9410) 2022-07-25 13:10:29 -07:00
Eric Anderson 0e45e04041
Avoid accidental locale-sensitive String.format()
%s is fairly safe (requires a Formattable to use Locale), so %d is the
main risk item. Places that really didn't need to use String.format()
were converted to plain string concatenation. Logging locations were
generally converted to using the log infrastructure's delayed
formatting, which is generally locale-sensitive but we're okay with
that. That wasn't done in okhttp, however, because Android frequently
doesn't use MessageFormat so we'd lose the parameters. Everywhere else
was explicitly defined to be Locale.US, to be consistent independent of
the default system locale.
2022-07-19 14:41:34 -07:00
yifeizhuang 756fdf3f2c
service: make the orca MetricReport a top level experimental class (#9382) 2022-07-18 13:23:55 -07:00
apolcyn 267d15412f
interop client: fix soak test bug where we can crash if peer wasn't set 2022-07-15 15:54:54 -07:00
yifeizhuang 6609f11f48
xds: do not expose orca proto in ORCA api (#9366)
The fix avoids shaded dependency of orca protos
2022-07-15 09:41:50 -07:00
Eric Anderson 9cd17ce3a7 Fix Gradle UP-TO-DATE checking for all tasks
The two checker tasks run quickly so don't gain much from UP-TO-DATE,
but it is convenient to not see them in the noise (checkUpperBoundDeps
in particular). Gradle only performs UP-TO-DATE checks (on the inputs)
if the task has both inputs and outputs defined.

The biggest saving was for distZip/distTar/shadowDistZip/shadowDistTar
which were using the same name for the non-shadow and shadow versions.
Thus the output file would always be out-of-date because it had been
rewritten and was invalid. This is worrisome because we could have
"randomly" been using the shadow Zip/Tar at times and the non-shadow
ones at others, although I think in practice the shadow tasks always run
last and so those are the files we'd see. Changing the classifier avoids
the colliding file names. These tasks took ~7 seconds, so incremental
builds are considerably shorter now.
2022-07-11 11:06:10 -07:00
Eric Anderson 57fe766d10 interop-testing: Hack runtimeOnly deps to be available at runtime
RuntimeOnly dependencies have been missing since 3624d59. This is
because the implementation configuration extendsFrom the shadow
configuration, so any of the things like runtimeOnly are being lost.
This change isn't "correct" but it stops the bleeding with minimal cost.
It is probably incorrect to be using shadow plugin in interop-testing at
all.
2022-07-11 10:31:40 -07:00
Eric Anderson 19ad4467db Service config parse failures should be UNAVAILABLE
INVALID_ARGUMENT is propagated to the data plane if no previous config
is available. INVALID_ARGUMENT is reserved for application use; LBs
should pretty much use UNAVAILABLE exclusively.

While most of the changes are in xds, there do not appear to be likely
xds code paths that would propagate a bad status to the data plane.
Internal policies either don't use parseLoadBalancingPolicyConfig() and
instead have their configuration objects constructed directly or are
constructed transitively through the cluster manager which uses INTERNAL
if there's a child failure. There was a worrisome hole before this
commit for StatusRuntimeExceptions received by the cluster manager, but
the audit didn't find any locations throwing such an exception.
User-selected policies produce a NACK and are protected from the
existing xds client watcher paths. The worst that appears could happen
is the channel could panic (which uses INTERNAL) if a bug let a bad
configuration through.
2022-07-08 15:49:12 -07:00
Eric Anderson 0ff9f37b9e Use Gradle's task configuration avoidance APIs
This can avoid creating an additional 736 tasks (previously 502 out of
1591 were not created). That's not all that important as the build time
is essentially the same, but this lets us see the poor behavior of the
protobuf plugin in our own project and increase our understanding of how
to avoid task creation when developing the plugin. Of the tasks still
being created, protobuf is the highest contributor with 165 tasks,
followed by maven-publish with 76 and appengine with 53. The remaining
59 are from our own build, but indirectly caused by maven-publish.
2022-07-08 12:16:40 -07:00
Eric Anderson 2fc7ac441c interop-testing: Add cartesian product HTTP/2 interop test 2022-07-01 12:38:01 -07:00
sanjaypujare 957d4e8b6f
Revert "interop-testing: add echo-server for proxyless gRPC testing in Istio (#9261)" (#9318)
This reverts commit c2d33f15be.
2022-06-27 17:30:47 -07:00
apolcyn 641746622e
interop-testing: add --soak_min_time_ms_between_rpcs flag and log peer addresses (#9282) 2022-06-27 16:31:25 -07:00
sanjaypujare c2d33f15be
interop-testing: add echo-server for proxyless gRPC testing in Istio (#9261) 2022-06-24 15:20:14 -07:00
Terry Wilson 7bd0797496
all: Update netty to 4.1.77.Final and netty_tcnative to 2.0.53.Final (#9027)
all: Update netty to 4.1.77.Final and netty_tcnative to 2.0.53.Final

Also switches to a non-release version of rules_jvm_external to allow Bazel build to work with artifact classifiers.
2022-06-24 10:47:27 -07:00
amirhadadi 7b80954fd5 core,interop-testing: avoid flushing after writing a message in case the server returns a single response 2022-06-24 07:13:25 -07:00
yifeizhuang f0c934e4c1
interop-test: fix import, no cast to ServerStreamCallObserver (#9299) 2022-06-21 12:41:33 -07:00
yifeizhuang 630d63b7cc
interop-testing: add orca_oob lock to allow only one test client at a time to perform the test case (#9260) 2022-06-17 10:41:30 -07:00
Eric Anderson b06942d63b Use Gradle's version catalog
This moves our depedencies into a plain file that can be read and
updated by tooling. While the current tooling is not particularly better
than just using gradle-versions-plugin, it should put us on better
footing. gradle-versions-plugin is actually pretty nice, but will be
incompatible with Gradle 8, so we need to wait a bit to see what the
future holds.

Left libraries as an alias for libs to reduce the commit size and make
it easier to revert if we don't end up liking this approach.

We're using Gradle 7.3.3 where it was an incubating fetaure. But in
Gradle 7.4 is became stable.
2022-06-14 14:04:10 -07:00
yifeizhuang 0d6c40227b
interop-testing: skip empty orca updates for unary at the server (#9256) 2022-06-09 16:42:45 -07:00
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