Commit Graph

6248 Commits

Author SHA1 Message Date
Terry Wilson 6cf6380812
releasing: add git command for pushing gh-pages (#10621) 2023-10-20 15:16:56 -07:00
Terry Wilson 2bec8cdf1d
Update README etc to reference 1.59.0 (#10620) 2023-10-20 14:29:26 -07:00
Mateus Azis 8966680015
binder: Allow async/slow implementations of authorization checks (#10596)
Allow a security policy to returns a `ListenableFuture<Status>` that
callers can implement to perform slower auth checks (like network
calls, disk I/O etc.) without necessarily blocking the gRPC calling
thread.

Partially addresses: https://github.com/grpc/grpc-java/issues/10566
2023-10-20 13:53:12 -07:00
Terry Wilson ccf9101828
interop-testing: allow disabling of stream tracers (#10609)
This adds the ability to disable the installation of stream tracers in
each test call in AbstractInteropTest. The tracers are stored in a list
and used to make assertions by normal tests, but a long running stress
test will accumulate too many entries in this list and the heap gets
wuickly filled up.
2023-10-17 08:37:15 -07:00
Larry Safran 0d39bf5018
lb:Implement LeastRequestLB as a petiole policy and restore RR and WRR (#10584)
* Change LeastRequest, Round Robin and WeightedRoundRobin into petiole policies
2023-10-16 16:40:20 -07:00
Terry Wilson fc03f2be9d Remove extra parenthesis 2023-10-09 17:17:50 -07:00
Terry Wilson 501246374c Line up usage and add assertions 2023-10-09 17:17:50 -07:00
Terry Wilson 21c287f7c3 interop-testing: Custom credentials in stress test
Adds support for specifying either google default or compute engine
"custom" credentials on the command line. This works like it does in
TestServiceClient.

Another feature from TestServiceClient is also included - the channel
builder is created differently when the server port is 0. This avoids
some ipv6 address parsing shenanigans.
2023-10-09 17:17:50 -07:00
Terry Wilson e488b67d99 gradle: Downgrade mockito to 4.4.0
Starting from version 4.5.0 Mockito uses the Java stream APIs, which are
not available on Android API levels < 24. This has been causing the
Android integration tests for API levels 21, 22 and 23 to fail.
2023-10-09 13:29:12 -07:00
amirhadadi 8c0545564f
Avoid flushing headers when the server returns a single response (#9314)
* core,netty: avoid flushing the headers on the server side when the server has a single response.
2023-10-09 09:43:10 -07:00
Anthony J. Pratti aec9a56eaf
cleanup: protobuf_java_lite typo in IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS (#10592) 2023-10-06 13:26:34 -07:00
Sergii Tkachenko ab8210ae0c
Stabilize forwarding builders (#10586)
- `ForwardingServerBuilder`
- `ForwardingChannelBuilder` - will be deprecated immidiatelly after
   stabilization
- `ForwardingChannelBuilder2` - should be used instead of
  `ForwardingChannelBuilder`
2023-10-06 11:18:29 -07:00
Terry Wilson 8a247ad16a interop-testing: Logging of stress test metrics
Introduces a flag to enable the logging of collected metrics. In some
cases it can be more practical to analyze the metrics from a log file
after the fact, instead of connecting to the metrics server to collect
the metrics as the client is running.
2023-10-05 16:19:31 -07:00
Terry Wilson bf9ccc68f5 Start 1.60.0 development cycle 2023-10-04 10:29:43 -07:00
Sergii Tkachenko 0e03654add core: Remove temporary AbstractManagedChannelImplBuilder
This breaks the ABI of the classes listed below.

Users that recompiled  their code using grpc-java [`v1.36.0`]
(https://github.com/grpc/grpc-java/releases/tag/v1.36.0) (released on
Feb 23, 2021) and later, ARE NOT AFFECTED.

Users that compiled their source using grpc-java earlier than
[`v1.36.0`]
(https://github.com/grpc/grpc-java/releases/tag/v1.36.0) need to
recompile when upgrading to grpc-java `v1.59.0`. Otherwise the code
will fail on runtime with `NoSuchMethodError`. For example, code:

```java
NettyChannelBuilder.forTarget("localhost:100").maxRetryAttempts(2);
```

Will fail with

> `java.lang.NoSuchMethodError: 'io.grpc.internal.AbstractManagedChannelImplBuilder
  io.grpc.netty.NettyChannelBuilder.maxRetryAttempts(int)'`

**Affected classes**

Class `AbstractManagedChannelImplBuilder` is deleted, and no longer in
the class hierarchy of the channel builders:
- `io.grpc.netty.NettyChannelBuilder`
- `io.grpc.okhttp.OkhttpChannelBuilder`
- `grpc.cronet.CronetChannelBuilder`
2023-10-03 10:35:16 -07:00
Sergii Tkachenko 050ae18e2a core: Remove temporary AbstractServerImplBuilder
This breaks the ABI of the classes listed below.

Users that recompiled  their code using grpc-java [`v1.36.0`]
(https://github.com/grpc/grpc-java/releases/tag/v1.36.0) (released on
Feb 23, 2021) and later, ARE NOT AFFECTED.

Users that compiled their source using grpc-java earlier than
[`v1.36.0`]
(https://github.com/grpc/grpc-java/releases/tag/v1.36.0) need to
recompile when upgrading to grpc-java `v1.59.0`. Otherwise the code
will fail on runtime with `NoSuchMethodError`. For example, code:

```java
NettyServerBuilder.forPort(80).directExecutor();
```

Will fail with

> `java.lang.NoSuchMethodError: 'io.grpc.internal.AbstractServerImplBuilder
  io.grpc.netty.NettyServerBuilder.directExecutor()'`

**Affected classes**

Class `AbstractServerImplBuilder` is deleted, and no longer in the
class hierarchy of the server builders:
- `io.grpc.netty.NettyServerBuilder`
- `io.grpc.inprocess.InProcessServerBuilder`
2023-10-03 10:35:16 -07:00
Eric Anderson 2cbc290755 okhttp: Make grpc-util an implementation dependency
This prevents grpc-util from being exposed on the classpath when
compiling code using grpc-okhttp. grpc-core is still needed because of
AbstractManagedChannelImplBuilder.
2023-09-29 15:10:02 -07:00
Eric Anderson 1d03bb80a9 Bump rules_jvm_external to 5.3
I'm not choosing any version in particular (just the latest). The main
point is to get off a "random" commit that had a fix for Netty.
2023-09-28 09:33:09 -07:00
Larry Safran bc784c0ef9
Revert "Change Round Robin and WeightedRoundRobin into petiole policies (#10528)" (#10575)
This reverts commit e1334eae7b.
2023-09-26 17:31:58 -07:00
Eric Anderson cf4cf03d79
api: Replace ErrorPicker with FixedResultPicker
FixedResultPicker can be used in more situations. Note that
WrrLocalityLoadBalancerTest's test was changed non-trivially. The
noChildLb test was particularly nasty as it assumed
LoadBalancer.ErrorPicker had same toString() as
GracefulSwitchLoadBalancer's ErrorPicker.
2023-09-26 15:28:29 -07:00
Eric Anderson a004096b3c Revert "stub: enable throwing rejected execution exception on ThreadlessExecutor shutdown (#10555)"
This reverts commit 5f480de2ee. We're
seeing it thrown in (b/301552213):

```
java.util.concurrent.RejectedExecutionException
	at io.grpc.stub.ClientCalls$ThreadlessExecutor.execute(ClientCalls.java:761)
	at io.grpc.internal.RetriableStream$Sublistener.closed(RetriableStream.java:954)
	at io.grpc.internal.ForwardingClientStreamListener.closed(ForwardingClientStreamListener.java:34)
	at io.grpc.internal.InternalSubchannel$CallTracingTransport$1$1.closed(InternalSubchannel.java:691)
	at io.grpc.internal.DelayedStream$DelayedStreamListener$4.run(DelayedStream.java:510)
	at io.grpc.internal.DelayedStream$DelayedStreamListener.delayOrExecute(DelayedStream.java:462)
	at io.grpc.internal.DelayedStream$DelayedStreamListener.closed(DelayedStream.java:507)
	at io.grpc.internal.AbstractClientStream$TransportState.closeListener(AbstractClientStream.java:458)
	at io.grpc.internal.AbstractClientStream$TransportState.-$$Nest$mcloseListener(AbstractClientStream.java)
	at io.grpc.internal.AbstractClientStream$TransportState$1.run(AbstractClientStream.java:441)
	at io.grpc.internal.AbstractClientStream$TransportState.deframerClosed(AbstractClientStream.java:278)
	at io.grpc.okhttp.OkHttpClientStream$TransportState.deframerClosed(OkHttpClientStream.java:297)
	at io.grpc.internal.MessageDeframer.close(MessageDeframer.java:234)
	at io.grpc.internal.MessageDeframer.closeWhenComplete(MessageDeframer.java:192)
	at io.grpc.internal.AbstractStream$TransportState.closeDeframer(AbstractStream.java:201)
	at io.grpc.internal.AbstractClientStream$TransportState.transportReportStatus(AbstractClientStream.java:444)
	at io.grpc.okhttp.OkHttpClientTransport.startGoAway(OkHttpClientTransport.java:899)
	at io.grpc.okhttp.OkHttpClientTransport.-$$Nest$mstartGoAway(OkHttpClientTransport.java)
	at io.grpc.okhttp.OkHttpClientTransport$ClientFrameHandler.run(OkHttpClientTransport.java:1123)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
	at java.lang.Thread.run(Thread.java:1012)
```
2023-09-25 13:50:06 -07:00
Anirudh Ramachandra fec7c2ea4a
Add fix for xdstp replacement for encoded authorities (#10571)
In ac35ab6 the logic in xDS Name resolver was changed to support encoded
authorities. This seems to cause an issue for xdstp replacements which
would percent encode the authority for the replacement causing double
encoding.

For example:

URI = xds:///path/to/service
Authority = path%2Fto%2Fservice
xdstp resource = xdstp:///envoy.config.listener.v3.Listener/path%252Fto%252Fservice

Here the authority is encoded due to slashes and during replacement we
percent encode it again causing %2F to change to %252F. To avoid this
issue, use the encoded authority only for the getServiceAuthority() API
and for all other use cases retain the unencoded authority.
2023-09-22 08:25:08 -07:00
Eric Anderson 88b3484a60 Bump Netty to 4.1.97.Final 2023-09-21 17:15:31 -07:00
Larry Safran 0c415e8784
Eliminate use of getOrDefault (#10565)
* Eliminate use of getOrDefault
2023-09-19 13:42:34 -07:00
sanjaypujare 7d9b76e330
examples: add an example for OAuth (#10560) 2023-09-18 09:56:16 -07:00
Larry Safran 6f09466edb
netty: Eliminate buffer release when there is an error as caller still owns the buffer. (#10537)
* netty: Eliminate buffer release when there is an error as caller still owns the buffer.
---------

Co-authored-by: Sergii Tkachenko <hi@sergii.org>
2023-09-15 15:18:03 -07:00
Larry Safran e1334eae7b
Change Round Robin and WeightedRoundRobin into petiole policies (#10528)
* Change Round Robin and WeightedRoundRobin into petiole policies
2023-09-15 10:27:36 -07:00
Terry Wilson 69986b542e COMPILING.md: Fix small typo 2023-09-14 12:03:20 -07:00
Eric Anderson 3eb5d20f6c servlet: Avoid lincheck for normal testing
It is slow, and just tries a bunch of possibilities. Leave it around for
developers to run locally, but it isn't precise enough to run on every
build. This change reduces the build of servlet in isolation by
1 minute. I suspect the gains are larger in a full grpc build because it
is very CPU-intensive; it uses 600% CPU on my 8-thread CPU when running
by itself.
2023-09-13 10:49:37 -07:00
John Cormie 134b0490d5
Enable indirect addressing using <intent-filter>s. (#10550)
AndroidComponentAddress now accepts an Intent with merely a package
restriction, not a full ComponentName. This lets clients avoid hard
coding Service class names that they don't control.

Fixes #9062
2023-09-12 17:27:35 -07:00
yifeizhuang 5f480de2ee
stub: enable throwing rejected execution exception on ThreadlessExecutor shutdown (#10555) 2023-09-12 13:41:15 -07:00
sanjaypujare 923ac60416
api: don't generate Java7 bytecode with Java 20+ (#10552)
Java 20+ don't support --release 7, so we just will use the default (8).
2023-09-11 13:41:50 -07:00
Eric Anderson b839b38b83 api: Add grpc-okhttp to suggestions if no server is available
Since 3b61799 OkHttp can support Grpc.newServerBuilderForPort().
2023-09-11 13:40:26 -07:00
yifeizhuang 6335e0be3e
core: DEADLINE_EXCEEDED gives hints for slow resolver (#10545) 2023-09-08 15:09:18 -07:00
yifeizhuang 75af7abf45
Update README etc to reference 1.58.0 (#10547) 2023-09-08 10:35:14 -07:00
Larry Safran 878e301a5c
netty: Respect io.netty.allocator.type="unpooled" when getting Netty Allocator (#10543)
Fixes #10292
2023-09-07 14:58:46 -07:00
Eric Anderson d4a163461a netty: Touch ByteBuf when message framing has been decoded
When a memory leak occurs, it is really helpful to have access records
to understand where the buffer was being held when it leaked. retain()
when we create the NettyReadableBuffer already creates an access record
the ByteBuf, so here we track when the ByteBuf is passed to another
thread.

See #8330
2023-09-07 13:15:22 -07:00
Eric Anderson 131a0047c4 netty: Use UNAVAILABLE for connections closed while writing
Fixes #10474 and b/273930962
2023-09-06 12:41:03 -07:00
Stephane Landelle cb2b68e39d core: only try to resolve InternalCensusStatsAccessor once 2023-09-06 11:12:04 -07:00
Stephane Landelle 22863dda38 netty: Use JUL instead of String.format 2023-09-06 11:12:04 -07:00
Eric Anderson 461dc85ba6 api: Make offload executor's purpose more clear
Blocking can be confused with the blocking stub, which is unrelated. I'm
purposefully not saying "it is used only for X," as that isn't what we
need from the API. But it is still helpful to users to describe the
sorts of things that use it.

Fixes #10508
2023-09-06 07:44:35 -07:00
kotlaja 9ab35b05de
java_grpc_library.bzl: Disable Automatic Exec Groups inside grpc libraries (#10514) 2023-09-05 17:21:10 -07:00
Terry Wilson 36e0af66fe
core: de-expermentalize pick first config parsing (#10531) 2023-08-30 15:40:34 -07:00
Terry Wilson b63e1579ed
testing: Stabilize TestMethodDescriptors (#10530) 2023-08-30 12:54:20 -07:00
Eric Anderson d15daed5e4 interop-testing: Modernize stress test channel creation
OverrideAuthority() is the modern alternative to rewriting the
InetAddress, and can also work if we change the channel creation to use
target strings instead. We can use test CAs now without resorting to the
Netty-specific APIs. After this change, only 4 classes in
interop-testing depend on Netty.
2023-08-25 16:55:46 -07:00
Larry Safran 92174be3df
Log warning message when server side gets exception writing message to stream and allow multiple closes (#10513)
* Use internalClose instead of close when sendMessage has a RuntimeException.
* Change argument to internalClose to a Throwable instead of a Status.
* Rename internalClose to handleInternalError
2023-08-24 16:40:23 -07:00
yifeizhuang 9424f8b4c7
Start 1.59.0 development cycle (#10519) 2023-08-24 11:25:28 -07:00
Terry Wilson 5559d54f5d
examples: Android helloworld to pass Google lint (#10518)
These changes allow the Android helloworld example to pass the lint
checks of the Google internal build system.
2023-08-24 10:37:53 -07:00
Larry Safran 3fad52129f
Fix aarch_64 macs not being able to build the compiler module. (#10516) 2023-08-23 14:58:11 -07:00
Terry Wilson 2b4f649b0a
android: Min SDK level to 21 (#10505)
Google Play has dropped support for SDK levels 19 and 20 and so can we.
2023-08-22 10:47:31 -07:00