pradeepbn commented on a change in pull request #2888:
URL: https://github.com/apache/bookkeeper/pull/2888#discussion_r754763607



##########
File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/PacketProcessorBase.java
##########
@@ -66,7 +66,9 @@ protected boolean isVersionCompatible() {
     }
 
     protected void sendResponse(int rc, Object response, OpStatsLogger 
statsLogger) {
-        channel.writeAndFlush(response, channel.voidPromise());
+        if (channel.isActive()) {

Review comment:
       `bookie1_1  | 02:15:08,926 ERROR Failed to submit a listener 
notification task. Event loop shut down?
   bookie1_1  | java.util.concurrent.RejectedExecutionException: event executor 
terminated
   bookie1_1  |    at 
io.netty.util.concurrent.SingleThreadEventExecutor.reject(SingleThreadEventExecutor.java:923)
 ~[netty-common-4.1.68.Final.jar:4.1.68.Final]
   bookie1_1  |    at 
io.netty.util.concurrent.SingleThreadEventExecutor.offerTask(SingleThreadEventExecutor.java:350)
 ~[netty-common-4.1.68.Final.jar:4.1.68.Final]
   bookie1_1  |    at 
io.netty.util.concurrent.SingleThreadEventExecutor.addTask(SingleThreadEventExecutor.java:343)
 ~[netty-common-4.1.68.Final.jar:4.1.68.Final]
   bookie1_1  |    at 
io.netty.util.concurrent.SingleThreadEventExecutor.execute(SingleThreadEventExecutor.java:825)
 ~[netty-common-4.1.68.Final.jar:4.1.68.Final]
   bookie1_1  |    at 
io.netty.util.concurrent.SingleThreadEventExecutor.execute(SingleThreadEventExecutor.java:815)
 ~[netty-common-4.1.68.Final.jar:4.1.68.Final]
   bookie1_1  |    at 
io.netty.util.concurrent.DefaultPromise.safeExecute(DefaultPromise.java:841) 
[netty-common-4.1.68.Final.jar:4.1.68.Final]
   bookie1_1  |    at 
io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:499)
 [netty-common-4.1.68.Final.jar:4.1.68.Final]
   bookie1_1  |    at 
io.netty.util.concurrent.DefaultPromise.addListener(DefaultPromise.java:184) 
[netty-common-4.1.68.Final.jar:4.1.68.Final]
   bookie1_1  |    at 
io.netty.channel.DefaultChannelPromise.addListener(DefaultChannelPromise.java:95)
 [netty-transport-4.1.68.Final.jar:4.1.68.Final]
   bookie1_1  |    at 
io.netty.channel.DefaultChannelPromise.addListener(DefaultChannelPromise.java:30)
 [netty-transport-4.1.68.Final.jar:4.1.68.Final]
   bookie1_1  |    at 
org.apache.bookkeeper.proto.PacketProcessorBaseV3.sendResponse(PacketProcessorBaseV3.java:91)
 [bookkeeper-server.jar:?]
   bookie1_1  |    at 
org.apache.bookkeeper.proto.WriteEntryProcessorV3.sendResponse(WriteEntryProcessorV3.java:180)
 [bookkeeper-server.jar:?]
   bookie1_1  |    at 
org.apache.bookkeeper.proto.WriteEntryProcessorV3$1.writeComplete(WriteEntryProcessorV3.java:108)
 [bookkeeper-server.jar:?]
   bookie1_1  |    at 
org.apache.bookkeeper.bookie.Journal$QueueEntry.run(Journal.java:335) 
[bookkeeper-server.jar:?]
   bookie1_1  |    at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) 
[?:?]
   bookie1_1  |    at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) 
[?:?]
   bookie1_1  |    at 
io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
 [netty-common-4.1.68.Final.jar:4.1.68.Final]
   bookie1_1  |    at java.lang.Thread.run(Thread.java:829) [?:?]`
   
   If we do not check for isActive(), we will get this exception at the time of 
shutdown. This happens because of nettyserver shutdown before the request 
processor.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to