Skip to content

RATIS-2629. Handle Netty based request asynchronously and improve exception handling - #1538

Open
spacemonkd wants to merge 1 commit into
apache:masterfrom
spacemonkd:RATIS-2629
Open

RATIS-2629. Handle Netty based request asynchronously and improve exception handling#1538
spacemonkd wants to merge 1 commit into
apache:masterfrom
spacemonkd:RATIS-2629

Conversation

@spacemonkd

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

RATIS-2629. Handle Netty based request asynchronously and improve exception handling

Currently NettyRpcService handles every inbound request synchronously on the Netty IO event-loop thread and its inbound handler does not override exceptionCaught.

This can cause:

  • a slow or long-running request occupies the worker thread delaying all other requests on that event loop
  • only IOException is converted into an error reply. Any other Throwable escapes the handler with no exceptionCaught, Netty's default handling only logs it and never writes a reply, so the client blocks until its request timeout.

This patch offloads the request handling out of the core IO path, and closes the channel to prevent blocking.
This mirrors how gRPC handles the requests.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/RATIS-2629

How was this patch tested?

Patch was tested via unit tests.

@spacemonkd

Copy link
Copy Markdown
Contributor Author

@szetszwo could you take a look?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant