ivankelly commented on a change in pull request #1233: ZOOKEEPER-3701 Split 
brain on log disk full
URL: https://github.com/apache/zookeeper/pull/1233#discussion_r370120580
 
 

 ##########
 File path: 
zookeeper-server/src/main/java/org/apache/zookeeper/server/persistence/FileSnap.java
 ##########
 @@ -260,6 +260,8 @@ public synchronized void serialize(
                     Util.getZxidFromName(snapShot.getName(), 
SNAPSHOT_FILE_PREFIX),
                     snapShot.lastModified() / 1000);
             }
+        } else {
+            throw new IllegalStateException("FileSnap has already been 
closed");
 
 Review comment:
   I dunno if I suggested IllegalStateException originally, but it's what I had 
in mind when I suggested this should throw an exception. 
   
   If you call close() on FileSnap, and it's already closed, that's a 
programmer's mistake. There *should not* be any handling for this, because the 
object is in a state which it should never be. The best thing in this case is 
for the process to crash (this isn't necessarily the case though, due to the 
catchall Exception handlers in QuorumPeer).

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to