Commit Graph

5393 Commits

Author SHA1 Message Date
yifeizhuang 78308c0c6a
okhttp: Fix okio 2.x API incompatibility (#9054) 2022-04-04 17:37:28 -07:00
Eric Anderson 18753b654f okhttp: Add Javadoc for ExceptionHandlingFrameWriter 2022-04-04 13:37:30 -07:00
Mohan Li 5b321c6096
interop-testing: register RLS 2022-04-04 12:20:31 -07:00
Eric Anderson a978c9edc0 okhttp: Avoid test-specific transport.start()
With the completely different constructor it was hard to track which
fields were different during the test and reduced confidence. Now the
test code flows are much closer to the real-life code flows.
2022-04-04 11:48:14 -07:00
Eric Anderson 004ee10a73
core: Vastly separate types of clock in FakeClock
There was an attempt to use different epochs for the wall clock and the
monotonic clock. However, 123456789 is actually less than a second.
We want the gap between clocks to be at least a day. This issue was
discovered in #8968.

This separation found a bug in an RLS test where it was mixing epochs.
However, it was only a problem in the test. The code under test is
wrongly using wall clock for calculation durations, but that seems to be
a wide-spread problem and will need to be handled separately.
2022-04-04 11:24:55 -07:00
Anirudh Ramachandra 79f2562306
xds: Improve code clarity by removing Unnecessary fully qualified names and using Immutable interface types. (#9025)
1. Unnecessary fully qualified names
Currently in XdsCredentialsRegistry, the child classes are referred by
their fully qualified names i.e.
'io.grpc.xds.internal.GoogleDefaultXdsCredentialsProvider' instead of
importing GoogleDefaultXdsCredentialsProvider and just using
GoogleDefaultXdsCredentialsProvider.class.

2. Use immutable interfaces instead of the generic collection interface
   i.e. ImmutableMap instead of just Map.

These improvements are related to #8924.
2022-04-04 07:19:53 -07:00
Eric Anderson 1ab7a6dd0f
xds: Remove sleeps in FileWatcherCertificateProviderTest (#8968)
This reduces test time by 7 seconds.
2022-04-01 16:35:51 -07:00
yifeizhuang db36905abf
okhttp: fix unreported exception (#9044) 2022-04-01 14:38:37 -07:00
Eric Anderson 432fcf4c98 xds: Reduce XdsServer.start() test time by 24.5s
Just using 100ms is mostly sufficient, but could potentially still flake
on the start()s that should return successfully. Waiting for the
XdsServingStatusListener to be called greatly reduces the amount of
processing needing to be done for start() to react and thus should
greatly avoid flakiness.
2022-04-01 13:34:26 -07:00
sanjaypujare fda3a2d6ff
gcp-observability: trim the string to remove newline for hostname and namespace name from files (#9043) 2022-04-01 10:11:54 -07:00
yifeizhuang c53c3ad01b
stub: enable GRPC_CLIENT_CALL_REJECT_RUNNABLE in ThreadlessExecutor shutdown (#9035) 2022-04-01 08:51:29 -07:00
Eric Anderson 574fbb4327
stub: Shutdown ThreadlessExecutor only if onClose() is called (#9041)
It is only safe to shutdown the executor if onClose() is called. Normal
RPC completions (both success and failure) will see the future complete,
so this only avoids shutting down in stranger cases like an interceptor
throwing an exception.
2022-04-01 08:49:34 -07:00
Kurt Alfred Kluever 71d38f5cae
Suppress CheckReturnValue error in PersistentHashArrayMappedTrieTest (#9038) 2022-03-31 19:50:11 -07:00
Kurt Alfred Kluever f04a49a7bd
Use try/catch idiom instead of @Test(expected = ...) (#9037) 2022-03-31 19:49:12 -07:00
yifeizhuang 7572afb32b
xds: verify and fix presubmit lints errors (#9036) 2022-03-31 12:07:44 -07:00
Eric Anderson 40c929e39f android: Use InternalManagedChannelProvider instead of reflection
This fixes up cda0e9d to be compatible with Proguard without
configuration. Since the methods are now accessed directly there is no
need for manual -keep configuration.
2022-03-31 11:52:57 -07:00
DNVindhya 86e3362298
observability: add configurable value for flush from configuration (#9034) 2022-03-30 18:03:36 -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
sanjaypujare 5113e92415
observability: rename Observability to GcpObservability (#9030)
* observability: rename Observability to GcpObservability
rename artifact to grpc-gcp-observability
enable maven publication of grpc-gcp-observability
2022-03-30 10:12:33 -07:00
Eric Anderson 30b5d6b840 RELEASING.md: Update variable name of grpc.io's config.yaml 2022-03-30 10:02:50 -07:00
Eric Anderson 0c642581e6 Update README etc to reference 1.45.1 2022-03-30 10:01:09 -07:00
DNVindhya 898e03b700
observability: implement filtering for logging and integrate tags to GcpLogSink (#9016) 2022-03-29 21:16:47 -07:00
Eric Anderson 957079194a xds: Unconditionally apply backoff on ADS stream recreation
This would limit ADS stream creation to one per second, even if the
old stream was considered good as it received a response. This shouldn't
really ever trigger, and if it does 1 QPS is probably still too high.
But 1 QPS is _substantially_ better than a closed loop and there's very
few additional signals we could use to avoid resetting the backoff.

b/224833499
2022-03-29 16:36:33 -07:00
yifeizhuang 72ae95792c
xds: add OrcaServiceImpl (#8993) 2022-03-29 08:48:02 -07:00
Carl Mastrangelo 6554061076
all: bump PerfMark to 0.25.0 (#8948) 2022-03-29 07:53:34 -07:00
sanjaypujare 9b1023bafe
observability: change the config parsing to not require logging_config (#9023)
and make Observability implement AutoCloseable
2022-03-28 16:20:26 -07:00
Eric Anderson 4a84c6fa96 bom: Remove protoc-gen-grpc-java
protoc-gen-grpc-java isn't useful in a BOM because the Gradle plugin
doesn't support BOMs (google/protobuf-gradle-plugin#412) and it seems
unlikely the Maven plugin would as well.

Right now the type is pom, which is useless; nobody cares about the pom
itself. We'd need to use a type of exe and repeat it for each platform
(classifier). Given that it is a strange case and we can't actually test
the results and having it in the bom might lead a user to trying to make
it work, let's just remove it for now until it provides value.

Fixes #8936
2022-03-28 14:39:12 -07:00
Kurt Alfred Kluever 31ce764723 Use `try/execute/fail/catch` instead of the strongly discouraged `@Test(expected=...)`
cl/437399696
2022-03-28 14:34:33 -07:00
Anirudh Ramachandra d3f7dc0059
xds: Support custom credentials using XdsCredentialsRegistry (#8924)
Currently the credentials used for xDS communications is hardcoded in the BootstrapperImpl. The bootstrap config chooses one of the possible hardcoded credential.

This commit adds support for a credential plugin which allows users to register custom credentials through XdsCredentialProviders. gRPC will automatically discover the implementations via Java's SPI mechanism

Bootstrapper will use XdsCredentialRegistry to retrieve the list of supported credentials. The current hardcoded list of credentials(google_default, insecure and tls) are registered by default to keep the behavior as is.
2022-03-28 10:20:50 -07:00
Eric Anderson cda0e9d996 android: Use Provider to construct OkHttpChannelBuilder
Doing any reflection on OkHttpChannelBuilder requires that all methods
can have their arguments resolved. We'd like to make okhttp an optional
dependency (to support okhttp 2 and 3/4 simultaneously). But making
okhttp optional means we can no longer construct OkHttpChannelBuilder
reflectively. We swap to the Provider that doesn't have this problem.
See #8971.

Note that ManagedChannelProvider itself only exposes its methods as
protected, so they wouldn't be accessible. However OkHttpChannelProvider
has its methods public. It is an open question of whether
ManagedChannelProvider's methods should become public, but in any case
we can hide a public OkHttpChannelProvider inside a package-private
class so it is only accessable via reflection. So this code assuming
public methods doesn't prevent future implementation hiding.
2022-03-24 14:51:57 -07:00
Terry Wilson 6c00f0052f xds: Return a null RouteAction when cluster has no cluster_specifier or route lookup is not enabled with a cluster_specifier_plugin.
We want to ignore the route in these situations, which is achieved by returning a null. The current behavior of returning an error triggers a NACK to the update.
2022-03-24 09:51:57 -07:00
Eric Anderson 700afafb10 xds: Fix LBs blindly propagating XdsClient errors
This is similar to 2a45524 (for #8950) but for additional similar cases.
2022-03-22 19:44:20 -07:00
ZHANG Dapeng 37904a02c0
rls: remove wrong empty address checke for child lb (#9005)
We shouldn't require addresses to be non-empty for the child lb of rls_lb. That might be a right requirement when the child lb is grpclb, but in our new usecase, the child lb will be cds lb and will only work if empty address is allowed.

Fixing b/223866089#comment24
2022-03-22 15:20:20 -07:00
Eric Anderson 4a0fe99f8a
netty: Support pseudo headers in all GrpcHttp2RequestHeaders methods
The previous code assumed that only gRPC would be using these methods.
But twice now Netty has made a change (generally relating to security)
that used a method for pseudo headers that previously wasn't supported.
Let's stop the whack-a-mole and just implement them all.

This restores compatibility with Netty 4.1.75.Final. Fixes #8981
2022-03-22 07:39:48 -07:00
sanjaypujare 2d7302d4fd
observability: integrate globalTags and configuration into rest of observability (#9000)
* observability: integrate globalTags and configuration into rest of observability
wire observabilityConfig and globalTags into Observability and make
these available to the channel and server interceptors and specifically
to the LogHelper. Also separate globalTags into custom-tags and location-tags as required by the log-helper
2022-03-21 16:05:43 -07:00
ZHANG Dapeng c772eb0f4e
rls: fix wrong grpcKeybuilder field name (#8999)
The `grpcKeybuilders` [field](9fb243ce29/grpc/lookup/v1/rls_config.proto (L176)) should not be `grpcKeyBuilders` in json format.

The mistake in Java was introduced since the [beginning](0fd4975d4c (diff-585b634c79155b4ac9417f7805e1b9d5f6d5c11a940c88e27fdf53c209e619cfR104)).
2022-03-21 14:29:02 -07:00
Lidi Zheng d196e588a2
Add more xds_lb test cases (#8998)
This test suite is only fully enabled for C++ and Python at this
moment. This commit enables the rest of the test suite for grpc-java.

* change_backend_service_test
* failover_test
* remove_neg_test
* round_robin_test
* affinity_test
2022-03-21 12:17:26 -07:00
Eric Anderson d216f26f7a COMPILING.md: Update Android SDK instructions for new downloads 2022-03-21 10:32:50 -07:00
apolcyn 04c2b190c0
Simplify fallback test client and parameterize fallback deadline (#8989) 2022-03-21 10:03:48 -07:00
yifeizhuang 012dbaf5be
xds: accept resources wrapped in a Resource message (#8997) 2022-03-18 17:36:23 -07:00
DNVindhya b4d8fc2c40
observability: implement server interceptor for logging (#8992) 2022-03-18 11:23:50 -07:00
Lidi Zheng d71bef5afe
Redirect xDS tests to use grpc/grpc's master branch (#8982)
We are solving the issue of grpc/grpc delaying the release, causing GCE
tests to fail. Updating the master branch prevents similar cases from
happening.

Tested: [prod:grpc/java/master/branch/xds_v3](http://sponge/010f5353-e65e-4b1a-b6d3-f5a84e31546b)
2022-03-17 09:55:41 -07:00
John Cormie 2bf0a1f271
binder: Dispatch transact() calls on an Executor when FLAG_ONEWAY would not be respected. (#8987)
Fixes #8914
2022-03-16 23:19:06 -07:00
DNVindhya 0628cab226
observability: implement client interceptor for logging (#8956) 2022-03-16 22:09:25 -07:00
Jesse Schalken 1a6840accd
Pass use_default_shell_env = True for protoc (#8984)
If protoc is compiled with MinGW it will depend on libstdc++-6.dll which is found in C:\msys64\mingw64\bin and can only be found by inheriting PATH from the environment.
2022-03-16 13:38:37 -07:00
sanjaypujare 35a065dabc
observability: implement configuration parsing for observability (#8976) 2022-03-16 11:59:16 -07:00
Zhouyihai Ding ad2c0f93f4
Support setting gRPClb initial fallback timeout by service config (#8980) 2022-03-16 09:55:15 -07:00
sanjaypujare 2097d6b615
observability: change alts and google_auth_oauth2 dependencies to implementation from api (#8986) 2022-03-16 09:34:08 -07:00
yifeizhuang 86b74d9ecc
core: delayedClientCall returns drainPendingCalls runnable in setCall (#8978)
`setCall()` returns drainPendingCalls runnable only when there are calls to drain, otherwise return null. Preserved the behaviour of `start()` and `cancel()`, as they are protected by `delayOrExecute()`.
2022-03-15 12:57:24 -07:00
sanjaypujare 87e13daf1a
observability: add support for global tags using env vars and MDS (#8946) 2022-03-14 11:56:03 -07:00