Skip to content

Use NettyChannelBuilder to enable blocking calls in callbacks#1559

Merged
lburgazzoli merged 1 commit intoetcd-io:mainfrom
cbornet:use-grpc-netty
Apr 28, 2026
Merged

Use NettyChannelBuilder to enable blocking calls in callbacks#1559
lburgazzoli merged 1 commit intoetcd-io:mainfrom
cbornet:use-grpc-netty

Conversation

@cbornet
Copy link
Copy Markdown
Contributor

@cbornet cbornet commented Jan 22, 2026

It's currently not possible to do blocking calls in listener handlers while preserving back-pressure as that blocks the vertx event loop (see #1089 #1285).
Instead of VertxChannelBuilder, we can use NettyChannelBuilder delegates onNext/onError/onCompleted to a thread-pool with ordering guarantees.
It is OK to do it as the vertx-grpc stubs are just wrappers around the grpc-java ones and don't actually use the vertx loop. So they are compatible with any ManagedChannelBuilder (eg. in unit tests InProcessChannelBuilder is used).

Alternatives:

NettyChannelBuilder delegates onNext/onError/onCompleted to a thread-pool with ordering guarantees.
It makes it possible to block in jetcd callbacks which is not possible with VertxChannelBuilder as that
blocks the vertx event loop.

Signed-off-by: cbornet <cbornet@hotmail.com>
@cbornet cbornet changed the title Use NettyChannelBuilder Use NettyChannelBuilder to enable blocking calls in callbacks Jan 23, 2026
@cbornet
Copy link
Copy Markdown
Contributor Author

cbornet commented Feb 9, 2026

Hi @lburgazzoli, would you have time to review ?

@lburgazzoli
Copy link
Copy Markdown
Collaborator

hope by the end of the week, please ping me again in case I won't

@cbornet
Copy link
Copy Markdown
Contributor Author

cbornet commented Feb 27, 2026

hope by the end of the week, please ping me again in case I won't

Hi @lburgazzoli, gentle ping.

@cbornet
Copy link
Copy Markdown
Contributor Author

cbornet commented Apr 21, 2026

@lburgazzoli , gentle ping ?

@lburgazzoli
Copy link
Copy Markdown
Collaborator

hey sorry, I promise I'll look into this before EOW, sorry again

@k8s-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cbornet, lburgazzoli

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@lburgazzoli lburgazzoli merged commit 724b495 into etcd-io:main Apr 28, 2026
9 checks passed
@lburgazzoli
Copy link
Copy Markdown
Collaborator

@cbornet merged it (sorry for the long delay),

Can you also look at:

@cbornet cbornet deleted the use-grpc-netty branch April 28, 2026 07:16
@cbornet
Copy link
Copy Markdown
Contributor Author

cbornet commented Apr 28, 2026

Awesome, thanks!

@cbornet
Copy link
Copy Markdown
Contributor Author

cbornet commented Apr 28, 2026

Can you also look at:
#1372

Yes, I already proposed a way to support blocking calls in listener handlers when using Vert.x : lburgazzoli#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants