Commit Graph

5777 Commits

Author SHA1 Message Date
Terry Wilson ec9b8e0d61
xds: Correctly start LRS clients in federation situations (#10000)
xds: Correctly start LRS clients in federation situations

The old code used a single member variable to indicate if load reporting
had already been started by XdsClientImpl. This boolean was used to
avoid starting a LoadReportClient more than twice. This works fine with
a single control plane server.

The problem occurs in federation situations where there is more than one
control plane and thus more than one LoadReportClient. Once the first
LoadReportClient is started, the member variable boolean is flipped to
true and no other LoadReportClients would be started.

This change removes the boolean member variable and relies on the fact
that starting an already started LoadReportClient is a no-op.
2023-04-03 18:35:48 -07:00
yifeizhuang bbe5a0227d
xds: fix flaky wrr test (#10004) 2023-04-03 09:14:44 -07:00
Larry Safran 10f5e5afd6
examples: Error details example (#9997)
* examples: Detail Error example (google.rpc.Status)
2023-03-31 16:04:27 -07:00
DNVindhya 9ea7506b2b
use glob for example file names which is used in updating release versions (#9998) 2023-03-31 10:24:05 -07:00
Larry Safran 42b4c61d5e
examples: Health example (#9991)
Provides a server with both a greet service and the health service.

   Client has an example of using the health service directly through the unary call
    <a href="https://github.com/grpc/grpc-java/blob/master/services/src/main/proto/grpc/health/v1/health.proto">check</a>
    to get the current health.  It also utilizes the health of the server's greet service
    indirectly through the round robin load balancer, which uses the streaming rpc
    <strong>watch</strong> (you can see how it is done in
    {@link  io.grpc.protobuf.services.HealthCheckingLoadBalancerFactory}).
2023-03-30 13:32:04 -07:00
Terry Wilson 8ceac65e7a
examples: custom load balancer example (#9951)
Example on how to implement a custom LoadBalancer
2023-03-28 11:51:41 -07:00
Larry Safran e0ddce8612
RELEASING.md:Addressed review comments. (#9995) 2023-03-27 18:17:13 -07:00
yifeizhuang 046e02bcdf
okhttp: forceful close after MAX_CONNECTION_AGE_GRACE_TIME (#9968) 2023-03-27 15:31:14 -07:00
Larry Safran e04c6ec9f6
examples:Client and Server sharing example (#9969)
examples:Client and server sharing example
Part of fixit.  Fixes b/259285817
2023-03-27 15:12:32 -07:00
Larry Safran 58e2224df9
Fix order dependent tests regarding message duration b/271122310 (#9930)
* Fix order dependent test by changing the initializations and comparison so that elapsed time isn't as significant in identifying whether it was the context or call option's duration that was used.

fixes b/271122310
2023-03-24 16:40:35 -07:00
Larry Safran 50a76610ee
docs:Improve instructions (#9974) 2023-03-24 16:39:55 -07:00
Terry Wilson 3d37dc4e9e
Update README etc to reference 1.54.0 (#9990) 2023-03-24 15:23:33 -07:00
Eric Anderson db433ae372
.github/workflows: Pass COVERALLS_REPO_TOKEN to coveralls task (#9935)
The coveralls task has been silently failing since we migrated to GitHub
Actions, away form Travis-CI:
```
no COVERALLS_REPO_TOKEN environmental variable found

no available CI service
> Task :grpc-all:coveralls

BUILD SUCCESSFUL in 23s
7 actionable tasks: 1 executed, 6 up-to-date
```

We'd rather not deal with private tokens, but the Coveralls GitHub
Action [only supports lcov][1] which makes it unhelpful for Java.
Looking deeper, yep, we [aren't the only ones impacted][2]:

[1]: https://github.com/marketplace/actions/coveralls-github-action
[2]: https://github.com/coverallsapp/github-action/issues/22
2023-03-24 12:51:14 -07:00
ZHANG Dapeng 85e656c0dc
Fix AsyncServletOutputStreamWriterConcurrencyTest flakiness (#9948)
The commit 792946132c (diff-cc7b2eb82d208e027f432435bcd324a46713c31096352f437417b770752f92abR197) makes it possible that the sleep can naturally wake up while `writeState` gets changes at the same time, causing a data race in the value of `parkingThread` between

792946132c/servlet/src/main/java/io/grpc/servlet/AsyncServletOutputStreamWriter.java (L199)

and 

792946132c/servlet/src/main/java/io/grpc/servlet/AsyncServletOutputStreamWriter.java (L218)

, in extreme scenario such as the CPU is stressed.

Fixes #9917
2023-03-24 11:20:38 -07:00
yifeizhuang 687340bbbe
interop-test: fix orca interop test client npe (#9989) 2023-03-24 10:05:56 -07:00
Dirk Haubenreisser 99cbdd5d69
Add support for cross-compiling for s390x platform (#9455)
* Added s390x platform support
* Adapt to existing platform naming scheme
* Updated s390_64 library whitelist
* Use g++ compiler version 8.x for s390x
* Introduced dedicated Docker container for building s390x artifacts Minor fix

---------

Signed-off-by: Dirk Haubenreisser <haubenr@de.ibm.com>
Co-authored-by: Eric Anderson <ejona@google.com>
2023-03-23 13:21:31 -07:00
Eric Anderson 39c9ebf180
examples: Add cancellation example
It uses the echo service for both unary and bidi RPCs, to show the
various cancellation circumstances and APIs.
2023-03-22 18:11:32 -07:00
Larry Safran 6b7cb9e4a4
examples: fix bazel build (#9986) 2023-03-22 18:02:49 -07:00
DNVindhya af8048b727
examples: add gcp-observability examples (#9967)
* add examples for gcp-observability
2023-03-22 17:02:25 -07:00
Stanley Cheung a6cdf498c9
Remove sleep from Observability Interop Test binary now that its done in close() (#9977)
After #9972, the `sleep()` is done inside Observability `close()`, we can remove this `sleep()` in the Observability Interop test binary.
2023-03-22 16:50:09 -07:00
DNVindhya 3634901849
gcp-o11y: add default custom tag for metrics exporter
This PR adds a default custom tag for metrics, irrespective of custom
tags being present in the observability configuration. 

OpenCensus by default adds a custom tag
[opencenus_task](https://docs.google.com/document/d/1sWC-XD277cM0PXxAhzJKY2X0Uj2W7bVoSv-jvnA0N8Q/edit?resourcekey=0-l-wqh1fctxZXHCUrvZv2BQ#heading=h.xy85j580eik0)
for metrics which gets overriden if custom tags are set.

The unique custom tag is required to ensure the uniqueness of the
Timeseries. The format of the default custom tag is:
`java-{PID}@{HOSTNAME}`, if `{PID}` is not available a random number
will be used.
2023-03-22 16:44:58 -07:00
Larry Safran 18a318c6c8
examples: waitForReady example (#9960)
Add an example using waitForReady

Part of fixit.  Fixes b/259286751
2023-03-22 12:14:00 -07:00
Kun Zhang dba3c04608
netty: implement GrpcHttp2InboundHeaders.iterator()
This will be used to generate more useful debugging information in
cases such as headers size exceeding the limit.
2023-03-22 12:11:26 -07:00
Kun Zhang 97aa279ed5
test/android: fix the import for AndroidJUnit4
Everywhere else is using
androidx.test.ext.junit.runners.AndroidJUnit4, and google internally
only has that variant.
2023-03-22 11:28:16 -07:00
DNVindhya 783de5dfc9
gcp-o11y: add sleep in Observability close()
This commit adds sleep in `close()` for metrics and/or traces to be
flushed before closing observability.

Currently sleep is set to 2 * [Metrics export interval (30 secs)].
2023-03-22 08:40:05 -07:00
Vindhya Ningegowda 9039d4dcff disable recording real-time metrics using in gcp-o11y 2023-03-21 16:17:30 -07:00
DNVindhya 844de39c26
gcp-observability, census: add trace information to logs (#9963)
This commit adds trace information (TraceId, SpanId and TraceSampled)
fields to LogEntry, when both logging and tracing are enabled in
gcp-observability. 

For server-side logs, span information was readily available using
Span.getContext() propagated via `io.grpc.Context`. Similar approach is
not feasible for client-side architecture.

Client SpanContext which has all the information required to be added
to logs is propagated to the logging interceptor via `io.grpc.CallOptions`.
2023-03-20 14:18:16 -07:00
yifeizhuang efce51be0b
examples: add reflection example (#9955) 2023-03-20 08:54:44 -07:00
Terry Wilson dc313f2e4e
examples: deadline example (#9958)
This provides an example on how a client can specify a deadline for an RPC. Also covers how deadlines are propagated to further RPCs a server might make.
2023-03-17 19:39:04 -07:00
yifeizhuang 4bbee69534
examples: add keepalive example (#9956) 2023-03-17 16:27:33 -07:00
Larry Safran 78fff08eb1
examples: Add an example for doing debug (#9957)
Extensive README, a server that exposes channelz and has pauses, and a client that uses multiple channels also exposes channelz service and has a 30 second delay to allow people to run the grpcdebug tool.

Fixit b/259286633
2023-03-17 16:26:06 -07:00
DNVindhya 1b799adc19
gcp-observability: Update logging fields for GA and use custom BatchingSettings (#9959)
This commit updates the following in gcp observability logging schema
* `payload.status_code` will be of type `google.rpc.Code` instead of `uint32`.
*  names in enum `Address.TYPE`

Use custom batching settings for [LoggingOptions](https://javadoc.io/doc/com.google.cloud/google-cloud-logging/latest/com/google/cloud/logging/LoggingOptions.html)

Note: Upgraded `com.google.cloud:google-cloud-logging` from `3.6.1` to `3.14.5`.
2023-03-17 15:53:46 -07:00
yifeizhuang c1ff4a856d
buildscript: iterate all example folder and build (#9961) 2023-03-17 15:09:58 -07:00
Jeff Davidson b8444d563d
binder: Expose client identity via a new abstract 'PeerUid' type (#9952)
The actual remote uid was kept private to prevent misuse.
2023-03-16 17:34:13 -07:00
DNVindhya b09473b0d3
census: Trace annotation for reporting inbound message sizes (#9944)
This commit uses [OpenCensus Annotation][] to report message size
[bytes] for inbound/received messages in traces.

`addMessageEvent` API which is currently used expects both uncompressed
and compressed message (optional) sizes to be reported at the same.
Since decompression for messages happens at a later point in time,
reporting compressed message as is and reporting uncompressed size as
`-1` renders the size as _0 bytes received_ in cloud tracing front end.

As a workaround, we add _two annotations for each received message_:
* For compressed message size
* For uncompressed message size (when it is available)

This commit also removes `addMessageEvents` a flag introduced in
PR #9485 to temporarily suppress message events for gcp-observability.

[OpenCensus Annotation]: https://www.javadoc.io/static/io.opencensus/opencensus-api/0.31.0/io/opencensus/trace/Annotation.html
2023-03-10 16:19:21 -08:00
Ken Katagiri 915c706dec android: Add UDSChannelBuilder
Allows using Android's LocalSocket via a Socket adapter. Such an adapter
isn't generally 100% safe, since some methods may not have any effect,
but we know what methods are called by gRPC's okhttp transport and can
update the adapter or the transport as appropriate.
2023-03-10 15:28:55 -08:00
Stanley Cheung cc03b480b8 Pass interop parameters to each langs run.sh as-is. run.sh should just pass through to the interop client/server binaries 2023-03-10 10:34:11 -08:00
Larry Safran 136665f00e
api,stub:Stabilize part of compression agreed to in the stabilization meeting (#9942)
* api,stub:Stabilize part of compression agreed to in the stabilization meeting.

addresses part of #1704
2023-03-09 12:25:43 -08:00
Terry Wilson 7ecb909776
buildscripts: Use Java 11 with android-interop (#9943) 2023-03-09 09:33:10 -08:00
Stanley Cheung 06ec0b93a5
interop-testing: Do not System.exit(0) from interop client
After #9937 was merged, the Java observability tests start to fail.

This System.exit(0) call in the existing Interop client main() method
prevented execution to continue in the new combined Observability
Interop test binary here. (The new binary is calling the old binary's
main() method.)
2023-03-08 11:53:42 -08:00
Terry Wilson b5b7cacba9
Upgrade Android Gradle plugin to 7.4.0 (#9933)
This is the latest version of the plugin supported by the Gradle version
in use at the moment (7.6).

Note that this also upgrades the R8 optimizer to a version (4.0.48) that
now uses "full mode" optimization by default.

This also splits off Android projects to run under Java 11 (Gradle
plugin requirement) while the other projects continue to run under Java
8.
2023-03-08 11:18:27 -08:00
Terry Wilson 2351e37dd7
binder: Do not fail binder build on javadoc errors (#9941)
We will be running this with Java 11, which has elevated some earlier
warnings to errors that fail the build. We don't want the build to fail
because of this.
2023-03-08 10:02:02 -08:00
Terry Wilson 3332199106
Start 1.55.0 development cycle (#9939) 2023-03-07 18:14:31 -08:00
Eric Anderson 4229191a23 Move gcp-observability interop binary out of interop-testing
gcp-observability has many dependencies so is a bit annoying in some
build systems to get working... just for it not to be used in
non-observability scenarios.

grpc-go and c core are using separate binaries for gcp-observability
interop testing, so do the same in Java, which makes interop-testing a
bit lighter.
2023-03-07 10:57:38 -08:00
Larry Safran 7aa5598dc0
api:stabilize offloadExecutor. (#9931)
* api:Stabalize offloadExecutor.

fixes #6279
2023-03-06 12:49:37 -08:00
Terry Wilson 56e4ce49bd
Rename AbstractXdsClient to ControlPlaneClient (#9934)
AbstractXdsClient is not abstract.
2023-03-06 10:35:32 -08:00
Stanley Cheung b55ecd5c35
GCP Observability Interop Testing Client/Server for Java (#9858) 2023-03-06 08:24:42 -08:00
Benjamin Peterson 4b6853b6dd
errorprone: enable UnnecessaryAnonymousClass (#9927)
The Java 7 compatibility rationale no longer holds.
2023-03-03 15:16:17 -08:00
DNVindhya 66f95b7ade
census: add per call latency metric (#9906)
* updated call latency measure with AGGREGATION_WITH_MILLIS_HISTOGRAM; added test for call latency view
2023-03-03 09:36:14 -08:00
Benjamin Peterson 5be17e8b22 build: allow Java 11+ to use modern error prone 2023-03-02 17:31:50 -08:00