You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "slfan1989 (via GitHub)" <gi...@apache.org> on 2026/02/24 20:39:49 UTC
[PR] RATIS-2418. NettyClient LoggingHandler prints too many messages. [ratis]
slfan1989 opened a new pull request, #1359:
URL: https://github.com/apache/ratis/pull/1359
## What changes were proposed in this pull request?
This PR reduces test log noise by adjusting logging levels and making logging more selective:
- `NettyRpcProxy.java`: Changed `LoggingHandler` from `LogLevel.WARN` to `LogLevel.DEBUG` with explanatory comment, since it emits all Netty pipeline events at the chosen level.
- `TestRaftAsyncWithNetty.java`: Override base class DEBUG settings by raising `RaftServer.Division` and `RaftClient` log levels back to INFO to reduce verbose test output.
- Modified `testWithLoad` Timer to only print cluster/client state when no progress is detected (moved logs into the "no progress" branch)
- Before changes:
- Timer prints unconditionally every `10` seconds (starting after 5 seconds)
- Log frequency = 1 time / 10 seconds = 6 times / minute
- After changes:
- Only prints when `no progress` is detected
- `No progress` definition: lastStep remains unchanged between consecutive Timer checks (10-second interval)
- lastStep update condition: cumulative progress delta ≥ 50 × numClients
- Trigger condition: cumulative progress delta < 50 × numClients within 10 seconds
- Converted all string concatenation logging to placeholder style (`{}`) for better performance and consistency
## What is the link to the Apache JIRA
JIRA: RATIS-2418. NettyClient LoggingHandler prints too many messages.
## How was this patch tested?
Existing unit tests.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] RATIS-2418. NettyClient LoggingHandler prints too many messages. [ratis]
Posted by "szetszwo (via GitHub)" <gi...@apache.org>.
szetszwo commented on PR #1359:
URL: https://github.com/apache/ratis/pull/1359#issuecomment-3955037734
When the callId is not found in replies, we probably should just ignore it but not failing.
```diff
+++ b/ratis-netty/src/main/java/org/apache/ratis/netty/NettyRpcProxy.java
@@ -157,6 +157,9 @@ public class NettyRpcProxy implements Closeable {
protected void channelRead0(ChannelHandlerContext ctx,
RaftNettyServerReplyProto proto) {
final CompletableFuture<RaftNettyServerReplyProto> future = getReplyFuture(getCallId(proto), null);
+ if (future == null) {
+ return;
+ }
if (proto.getRaftNettyServerReplyCase() == EXCEPTIONREPLY) {
final Object ioe = ProtoUtils.toObject(proto.getExceptionReply().getException());
future.completeExceptionally((IOException)ioe);
@@ -199,7 +202,6 @@ public class NettyRpcProxy implements Closeable {
private CompletableFuture<RaftNettyServerReplyProto> getReplyFuture(long callId,
CompletableFuture<RaftNettyServerReplyProto> expected) {
final CompletableFuture<RaftNettyServerReplyProto> removed = replies.remove(callId);
- Objects.requireNonNull(removed, () -> "Request #" + callId + " not found");
if (expected != null) {
Preconditions.assertSame(expected, removed, "removed");
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] RATIS-2418. NettyClient LoggingHandler prints too many messages. [ratis]
Posted by "slfan1989 (via GitHub)" <gi...@apache.org>.
slfan1989 commented on PR #1359:
URL: https://github.com/apache/ratis/pull/1359#issuecomment-3955036579
> TestRaftAsyncWithNetty.testWithLoad(..) failed with NPE:
>
> ```
> Caused by: java.lang.NullPointerException: Request #3851 not found
> at java.base/java.util.Objects.requireNonNull(Objects.java:336)
> at org.apache.ratis.netty.NettyRpcProxy$Connection.getReplyFuture(NettyRpcProxy.java:203)
> at org.apache.ratis.netty.NettyRpcProxy$Connection.access$100(NettyRpcProxy.java:149)
> at org.apache.ratis.netty.NettyRpcProxy$Connection$1.channelRead0(NettyRpcProxy.java:159)
> at org.apache.ratis.netty.NettyRpcProxy$Connection$1.channelRead0(NettyRpcProxy.java:155)
> at org.apache.ratis.thirdparty.io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)
> at org.apache.ratis.thirdparty.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
> ... 25 more
> ```
@szetszwo Thanks for your message—I’ll follow up on this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] RATIS-2418. NettyClient LoggingHandler prints too many messages. [ratis]
Posted by "slfan1989 (via GitHub)" <gi...@apache.org>.
slfan1989 commented on PR #1359:
URL: https://github.com/apache/ratis/pull/1359#issuecomment-3954620148
@szetszwo Could you please take a look and share your feedback when you have a moment? Thanks a lot!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] RATIS-2418. NettyClient LoggingHandler prints too many messages. [ratis]
Posted by "szetszwo (via GitHub)" <gi...@apache.org>.
szetszwo commented on PR #1359:
URL: https://github.com/apache/ratis/pull/1359#issuecomment-3955009482
TestRaftAsyncWithNetty.testWithLoad(..) failed with NPE:
```
Caused by: java.lang.NullPointerException: Request #3851 not found
at java.base/java.util.Objects.requireNonNull(Objects.java:336)
at org.apache.ratis.netty.NettyRpcProxy$Connection.getReplyFuture(NettyRpcProxy.java:203)
at org.apache.ratis.netty.NettyRpcProxy$Connection.access$100(NettyRpcProxy.java:149)
at org.apache.ratis.netty.NettyRpcProxy$Connection$1.channelRead0(NettyRpcProxy.java:159)
at org.apache.ratis.netty.NettyRpcProxy$Connection$1.channelRead0(NettyRpcProxy.java:155)
at org.apache.ratis.thirdparty.io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)
at org.apache.ratis.thirdparty.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
... 25 more
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org