snuyanzin commented on code in PR #28489:
URL: https://github.com/apache/flink/pull/28489#discussion_r3443599528


##########
flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/state/rocksdb/restore/RocksDBHandle.java:
##########
@@ -306,7 +313,13 @@ public DBOptions getDbOptions() {
     @Override
     public void close() throws Exception {
         IOUtils.closeQuietly(defaultColumnFamilyHandle);
-        IOUtils.closeQuietly(nativeMetricMonitor);
+        if (nativeMetricMonitor != null) {
+            // Monitor owns the statistics wrapper.
+            IOUtils.closeQuietly(nativeMetricMonitor);
+        } else {

Review Comment:
   `closeQuietly` has it's own internal non null check
   given that, can it be simplified to just 
   ```java
           IOUtils.closeQuietly(nativeMetricMonitor);
           IOUtils.closeQuietly(statistics);
   ```
   ?



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