szetszwo commented on code in PR #1369:
URL: https://github.com/apache/ratis/pull/1369#discussion_r2922497315


##########
ratis-server/src/main/java/org/apache/ratis/server/leader/LogAppenderBase.java:
##########
@@ -124,7 +124,10 @@ public void start() {
 
   @Override
   public boolean isRunning() {
-    return daemon.isWorking() && server.getInfo().isLeader();
+    return daemon.isWorking()
+        && server.getInfo().isAlive()
+        && server.getInfo().isLeader()
+        && getRaftLog().isOpened();
   }

Review Comment:
   `Thread.currentThread().isInterrupted()` is a runtime state but not an 
object state.  So, it probably should not be in LogAppenderBase.isRunning().
   
   Hypothetically, suppose we have a CLI to ask if a LogAppender is running.  
The CLI processing thread will call LogAppender.isRunning().  However, 
LogAppender.isRunning() has nothing to do with whether the CLI processing 
thread is interrupted.
   
   > Saw the following InterruptedIOException from GrpcLogAppender#sleep which 
should set the current interrupt flag, but seems it's never checked ...
   
   The InterruptedIOException should be caught in LogAppenderDaemon.run().  
Isn't it?



-- 
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