Commit Graph

6893 Commits

Author SHA1 Message Date
Eric Anderson 3be3c5ed0d Bump version to 1.76.3 2026-01-27 13:10:35 -08:00
Eric Anderson fdf6b68fac Update README etc to reference 1.76.3 2026-01-27 13:10:35 -08:00
Kim Jin Young 28db3fc8fa servlet: disable RECYCLE_FACADES to reduce flaky tests
Set discardFacades=false in Tomcat 10 Embedded to avoid premature
OutputBuffer recycling. This works around flaky tests in gRPC servlet
transport by ensuring facades are not discarded too early.

Fixes #12524
2026-01-27 07:45:04 -08:00
Eric Anderson c52f2b91e7 servlet: Ignore timeoutOnSleepingServer for Tomcat
tomcat10Test is frequently failing on Windows because Tomcat doesn't
support trailers-only. I removed the FIXMEs because we won't workaround
Tomcat in grpc-servlet because:

1. An interceptor that converts trailers-only into headers+trailers
   would handle most cases, as it could run directly next to the
   application.  That is semantically very safe. But an interceptor
   doesn't help deadline handling and other transport-caused closures,
   as those trailers-only are produced by the transport
2. Having the transport convert trailers-only would work for deadline
   handling, but is not semantically safe
3. The other languages didn't find Tomcat to be important enough to
   support HEADERS+empty DATA(END_STREAM) as trailers-only on the
   client-side

```
Unexpected status: Status{code=INTERNAL, description=Received unexpected EOS on empty DATA frame from server, cause=null}
value of: getCode()
expected: DEADLINE_EXCEEDED
but was : INTERNAL
	at app//io.grpc.testing.integration.AbstractInteropTest.assertCodeEquals(AbstractInteropTest.java:2028)
	at app//io.grpc.testing.integration.AbstractInteropTest.timeoutOnSleepingServer(AbstractInteropTest.java:1644)
```
2026-01-27 07:44:43 -08:00
Eric Anderson a7479d8042 buildscripts: Convert GAE CI to Cloud Build
The Google App Engine build now requires Java 17, because the App Engine
libraries are now using Java 17 bytecode. The Kokoro environment doesn't
include Java 17, and while we could make some custom pools to resolve
it, it is easier to swap to Cloud Build than to fight and maintain the
Kokoro images. With Cloud Build we can also restrict permissions easier,
as the same workers aren't used for multiple tasks.

However, the Gradle App Engine plugin doesn't support choosing a service
account for GAE, so I swapped to using gcloud app deploy.

Although we'll be using restricted service accounts, we'll configure
Cloud Build to require a "/gcbrun" GitHub comment except for owners and
collaborators of the repository, similar to the "kokoro:run" label
today.

I swapped the Gradle code to use project properties instead of system
properties, as we really should have been using project properties to
begin with and I didn't want to add new system properties. The sleep has
probably been unnecessary since the turndown of GAE Java 7, when the
architecture of GAE changed considerably. But today it is very possible
a new instance is spun up for that request and GAE does a warmup
request, so the delay seems unlikely to help anything and was excessive
at 20 seconds.

The Cloud Build file _doesn't_ include GAE in its name because it can do
more than GAE testing and it is easy to run things in parallel in Cloud
Build (although they share the worker). In particular, some of the
Android tests may make sense to migrate away from Kokoro.

We're using e2-standard-16 for Kokoro and it takes about 10 minutes.
With the default Cloud Build worker e2-standard-2 it takes 20 minutes,
and with e2-highcpu-8 it takes 10 minutes with 4 minutes spent on app
deploy.

The expectation is to run this with a Java-CI-specific service account,
so we have configure logging ourselves. I chose CLOUD_LOGGING_ONLY
because it was easy, but we'll want to configure GCS in the future to
allow external contributors to see the logs.
2026-01-27 07:44:15 -08:00
Eric Anderson 354d8b4511 Downgrade OpenTelemetry to 1.51.0
opentelemetry-exporter-sender-okhttp and
opentelemetry-sdk-extension-jaeger-remote-sampler in OpenTelemetry
1.52.0 started depending on OkHttp 5.x. That introduces compatibility
issues that need some time to resolve, so downgrade for the moment.
While we don't depend on either of those modules, BOMs can make sure
versions are consistent across modules, and we don't want to encourage
our users to downgrade our dependencies.

See also
https://github.com/open-telemetry/opentelemetry-java/issues/8001
2026-01-27 07:43:46 -08:00
Eric Anderson 953a137a46 Bump version to 1.76.3-SNAPSHOT 2025-12-04 13:45:11 -08:00
Eric Anderson 4554b3076f Bump version to 1.76.2 2025-12-04 13:43:13 -08:00
Eric Anderson 6bc32d5ba7 Update README etc to reference 1.76.2 2025-12-04 13:40:23 -08:00
Eric Anderson bb07f79d46 rls: Avoid missed config update from reentrancy
Since ChildPolicyWrapper() called into the child before
childPolicyMap.put(), it is possible for that child to call back into
RLS and further update state without that child being known. When CDS
is_dynamic=true (since ca99a8c47), it registers the cluster with
XdsDependencyManager, which adds a watch to XdsClient. If XdsClient
already has the results cached then the watch callback can be enqueued
immediately onto the syncContext and execute still within the
constructor.

Calling into the child with the lock held isn't great, as it allows for
this type of reentrancy bug. But that'll take larger changes to fix.

b/464116731
2025-12-04 10:17:57 -08:00
Eric Anderson 4d5e4185dd Bump version to 1.76.2-SNAPSHOT 2025-11-14 10:46:36 -08:00
Eric Anderson bf6ddec419 Bump version to 1.76.1 2025-11-14 10:44:21 -08:00
Eric Anderson a9eaf5173d Update README etc to reference 1.76.1 2025-11-13 15:45:58 -08:00
Eric Anderson bab8c7a71d core: Fix NPE during address update with Happy Eyeballs
Fixes #12168
2025-11-13 07:38:58 -08:00
Abhishek Agrawal 8e850d8d8c
README: update remaining references of protoc (#12411) 2025-10-09 09:40:57 +05:30
Abhishek Agrawal e5dfa10f81 Bump version to 1.76.1-SNAPSHOT 2025-10-06 16:02:59 +00:00
Abhishek Agrawal d0db129739 Bump version to 1.76.0 2025-10-06 15:52:15 +00:00
Abhishek Agrawal aa672ca125 Update README etc to reference 1.76.0 2025-10-06 15:41:59 +00:00
Eric Anderson 70b7249da8 netty: Unconditionally disable adaptive cumulator (#12390)
io.netty.util.Version is unreliable, so we stop using it. grpc-netty and
grpc-netty-shaded have their version.properties mix, and you can't tell
which is which.

Changed the tests to use assume, so it is clear in the results that they
weren't run.
2025-10-01 11:13:47 -07:00
Alex Panchenko f89d1d8fd4 api: remove nullable from StatusOr value methods (#12338)
It someone wants it nullable, that should be defined via the type
parameter, e.g. `StatusOr<@Nullable Foo> foo`
2025-10-01 11:13:34 -07:00
Eric Anderson 040665f243 examples: Explain Bazel BCR releases and git_override option 2025-09-19 13:23:49 -07:00
Eric Anderson 4995700069 xds: Remove verify TODO for onResult2 error status
This had been accidentally left in 0c179e3f9.

Requesting a refresh is pretty close to RetryingNameResolver's behavior
of exponential backoff. While not identical, it is the closest we can
get easily.
2025-09-19 08:23:51 -07:00
Eric Anderson afe72220d0
SECURITY.md: Mention gcompat for Alpine (#12365)
In the olden days Alpine didn't work at all. Then it worked. And then
sometime in 2021 it started failing (#8751) because of missing
__strndup. The most recent deep investigation showed it is missing
__strdup these days
https://github.com/grpc/grpc-java/issues/11660#issuecomment-2469284111 .

I'm not expecting too many people to find this themselves, but we can
link to it when they experience problems.
2025-09-19 11:25:53 +05:30
dmytroreutov 1a7042ac98
android: fix network change handling on API levels < 24
Fixes https://github.com/grpc/grpc-java/issues/12313

In case if VPN toggled on<->off `wasConnected` returns true and
`delegate.enterIdle()` is skipped.
2025-09-18 12:51:25 -07:00
Patrick Strawderman 8f0db07d5d
api: Avoid allocating empty array in LoadBalancer (#12337)
Use a singleton empty Object array to initialize the customOptions
default in LoadBalancer.Builder.
2025-09-18 12:43:40 -07:00
Eric Anderson 0c179e3f9e
xds: Convert ClusterResolverLb to XdsDepManager
No longer need to hard-code pick_first because of gRFC A61.
https://github.com/grpc/proposal/pull/477
2025-09-18 11:08:43 -07:00
Eric Anderson 4b5ce99b02 binder: Fix synchronization instead of suppressing GuardedBy
There's no reason why we shouldn't just have proper synchronization
here, even if only used in tests. We shouldn't get into the habit of
suppressing them.
2025-09-17 11:36:16 -07:00
Kannan J ead6a54602
binder: Suppress GuardedBy("this") warning for test access (#12362)
Co-authored-by: MV Shiva <speakupshiva@gmail.com>
2025-09-16 15:00:43 +05:30
Alex Panchenko d163c063b9
servlet: add extra 5s to AsyncContext timeout (#12321)
Currently there is a race between 2 tasks scheduled to handle request
timeout
* servlet AsyncContext timeout
* gRPC Context

which can cause instability. This change makes the gRPC Context timeout happen first.
2025-09-16 10:20:11 +05:30
Alex Panchenko 6f21bc2e6c
servlet: configurable methodNameResolver (#12333)
Introduces configuring a method name resolver in `ServletServerBuilder` for customizing the servlet context root path for request paths.
2025-09-16 09:17:18 +05:30
Umair Khan 6fae71b740
netty: disable Huffman coding in server response headers (#12357)
Follow up to PR #10563

Previously, we disabled Huffman encoding on the `NettyClientHandler` to
improve header encoding performance. This change also ensures
consistency in the header encoding strategy across both client and
server components.
2025-09-15 18:17:47 +05:30
Sangamesh c1f3287601
util: Fix misleading exception in AdvancedTlsX509TrustManager when cert file is missing (#12353) 2025-09-15 18:04:09 +05:30
Benjamin Peterson 53d81116c5
stub: fix typo in method name (#12356) 2025-09-15 09:39:17 +05:30
MV Shiva fe54dd618d
Add support for macOS aarch64 with universal binary (#12319) 2025-09-13 13:37:32 +05:30
MV Shiva 866d226c14
compiler: Mangle generated method names that conflict with java.lang.Object methods (#12332)
Generated gRPC method names in the BlockingV2Stub can conflict with
final methods on `java.lang.Object` (e.g., `toString()`, `hashCode()`)
for client-streaming and bidi-streaming RPCs. This occurs because
they are generated with no arguments, leading to a compilation error.
One such case in #12331.

This change introduces a dedicated list of no-argument method names
from java.lang.Object and applies name-mangling (appending an
underscore) only when generating these specific methods in the
v2 blocking stub.

This resolves the compilation failure while ensuring that the behavior
for all other stubs remains unchanged.

Fixes: #12331
2025-09-13 11:54:48 +05:30
John Cormie e91378cf96
binder: Only accept post-setup transactions from the server UID we actually authorize. (#12359) 2025-09-12 16:23:54 -07:00
John Cormie 7d6ea288a2
Add a basic SocketStats with just the local and remote addresses. (#12349)
This will make channelz more useful.
2025-09-11 08:13:56 -07:00
jiangyuan b2a95cae72
netty, okhttp: Add allow header for response code 405 (#12334)
Fixes #12329
2025-09-10 17:39:33 +05:30
Abhishek Agrawal d4e1b69e78
otel: subchannel metrics A94 (#12202)
Implements [A94](https://github.com/grpc/proposal/pull/485/files) except for the exact reason for disconnect_error
2025-09-09 03:25:40 +05:30
Sangamesh 5a543726fd
android-interop-testing : Fix lint warnings in android-interop and binder modules (#12272)
Fixes #6868
2025-09-04 11:25:04 +05:30
Eric Anderson 01f2862b90 xds: Pretty-print Resource in logs
Noticed at b/431017968#comment31
2025-09-03 20:30:18 -07:00
Eric Anderson b3390227ae Remove org.apache.tomcat:annotations-api dep
f8700a1 stopped using the dependency in our generated code and removed
the dependency the Bazel build. 4f6948f removed mention of the
dependency in our README. This deletes it from our Gradle build and the
examples.
2025-09-03 07:18:18 -07:00
MV Shiva 9746bb4bc3
allow java21 in jre matrix (#12281) 2025-09-01 13:10:09 +05:30
zrlw d9509b5bb3
Upgrade guava version to 33.4.8 (#12219)
Guava seems to call a deprecated sun.misc.Unsafe::objectFieldOffset
method which might be removed in a future JDK release.
There are still a few things to do for -android versions, which are
tracked in https://github.com/google/guava/issues/7742,
see details at google/guava#7811

Fixes #12215
2025-08-29 14:01:11 -07:00
Kannan J 4f6948f594
Remove org.apache.tomcat:annotations-api from README (#12320)
With the default @generated=omit option used by grpc-compiler, it is no longer necessary to have the compile-only dependency on org.apache.tomcat:annotations-api.
2025-08-29 12:00:22 +05:30
Hongxu Xu 3d5eff99ec
bazel: remove unnecessary build deps (#12310) 2025-08-28 16:12:16 -07:00
Lam Gia Thuan 7322c075ba
bazel: Use java/proto rules from rules_java/rules_proto instead of native rules
It's discouraged in modern Bazel to use native rules and will make it
difficult for modules dependent on grpc-java to fully migrate to new
versions of Bazel (like grpc-kotlin).

For example, try building this repo using:

```bash
$ bazelisk build ... --incompatible_autoload_externally=
```

It will fail.

**IMPORTANT**: Now you still see errors after this commit, but it's
better because the errors come from `@protobuf`, not `@grpc-java`.
2025-08-28 16:07:14 -07:00
John Cormie ad5c6d5575
binder: Replace queryIntentServices() hack with the new SystemApis.createContextAsUser() (#12280)
createContextAsUser() wrapper makes the call to PackageManager's
resolveService() look the same in both the same-user and cross-user
cases. This is how the Android team recommends accessing XXXAsUser() APIs in
general.

We can also remove all the apologies for using reflection since
SystemApis already explains all that.
2025-08-28 15:58:39 -07:00
Eric Anderson cdd3202a1f interop-testing: Show full status for interop test failures
It's pretty annoying to see a test failure with
"expected:<DEADLINE_EXCEEDED> but was:<INTERNAL>" and not know the
description or throwable cause of the status. Introduce a convenience to
include the full status on unexpected Status.Code. There were two
usages of assertWithMessage() that did give nice errors; those were
converted to this new utility.

It'd be even better to make a StatusSubject, but that'd take more time
and this was easy and still an improvement. This was created because
we're seeing servlet test failures with INTERNAL code, and we need to
see the details.
2025-08-28 07:55:02 -07:00
John Cormie c643e68aa1
binder: REMOTE_UID must hold exactly the uid passed to the SecurityPolicy and never change (#12314)
`attributes = setSecurityAttrs(attributes, remoteUid);` should not run
for :
- a malformed SETUP_TRANSPORT transaction
- a rogue SETUP_TRANSPORT transaction that arrives
post-TransportState.SETUP
2025-08-28 01:06:48 -07:00