Tsz-wo Sze created RATIS-2347:
---------------------------------
Summary: NPE in GrpcServerProtocolService
Key: RATIS-2347
URL: https://issues.apache.org/jira/browse/RATIS-2347
Project: Ratis
Issue Type: Bug
Components: gRPC
Reporter: Tsz-wo Sze
Assignee: Tsz-wo Sze
When a request has timed out, the reply is null. Then, it will cause the
NullPointerException below when calling TextFormat.shortDebugString(reply)
{code}
java.lang.NullPointerException: Cannot invoke
"org.apache.ratis.thirdparty.com.google.protobuf.MessageOrBuilder.getDescriptorForType()"
because "message" is null
at
org.apache.ratis.thirdparty.com.google.protobuf.TextFormat$Printer.print(TextFormat.java:340)
at
org.apache.ratis.thirdparty.com.google.protobuf.TextFormat$Printer.shortDebugString(TextFormat.java:616)
at
org.apache.ratis.thirdparty.com.google.protobuf.TextFormat.shortDebugString(TextFormat.java:99)
at
org.apache.ratis.grpc.server.GrpcServerProtocolService$ServerRequestStreamObserver.lambda$null$7(GrpcServerProtocolService.java:179)
at
org.apache.ratis.util.BatchLogger$BatchedLogEntry.execute(BatchLogger.java:83)
at
org.apache.ratis.util.BatchLogger$BatchedLogEntry.access$200(BatchLogger.java:74)
at org.apache.ratis.util.BatchLogger.lambda$null$1(BatchLogger.java:123)
at java.base/java.util.Optional.ifPresent(Optional.java:178)
at
org.apache.ratis.util.BatchLogger.lambda$print$2(BatchLogger.java:123)
at
org.apache.ratis.util.TimeoutTimer.lambda$onTimeout$2(TimeoutTimer.java:101)
at org.apache.ratis.util.LogUtils.runAndLog(LogUtils.java:38)
at org.apache.ratis.util.LogUtils$1.run(LogUtils.java:78)
at org.apache.ratis.util.TimeoutTimer$Task.run(TimeoutTimer.java:55)
at java.base/java.util.TimerThread.mainLoop(Timer.java:566)
at java.base/java.util.TimerThread.run(Timer.java:516)
{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)