eolivelli 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_r370082976
##########
File path:
zookeeper-server/src/main/java/org/apache/zookeeper/server/persistence/FileTxnSnapLog.java
##########
@@ -595,7 +600,9 @@ public void rollLog() throws IOException {
*/
public void close() throws IOException {
txnLog.close();
+ txnLog = null;
Review comment:
if you set this variable to null then calling twice this method will result
in an ugly NullPointerException
what about
```
try {
if (txnLog != null) {
txnLog.close();
}
} finally {
txnLog = null;
}
```
----------------------------------------------------------------
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