yihua commented on code in PR #18484:
URL: https://github.com/apache/hudi/pull/18484#discussion_r3055369691
##########
hudi-common/src/main/java/org/apache/hudi/common/util/collection/RocksDBDAO.java:
##########
@@ -465,6 +470,32 @@ public void addColumnFamily(String columnFamilyName) {
});
}
+ /**
+ * Retrieves a numeric property aggregated across all column families.
+ */
+ public long getLongProperty(String property) throws RocksDBException {
+ return getRocksDB().getAggregatedLongProperty(property);
+ }
Review Comment:
🤖 There's a potential use-after-free here. Flink's metric reporter runs on a
background thread and will call this gauge periodically. During task shutdown,
the main thread enters the `synchronized close()`, calls `statistics.close()`
(freeing the native `Statistics*` pointer), then sets `statistics = null`. If
the reporter thread passes the null check just before that happens and then
calls `statistics.getTickerCount()` via JNI on the already-freed native object,
you get a native crash. Since `statistics` isn't `volatile` either, the null
assignment may not even be visible to the reporter thread at all. Synchronizing
`getTickerCount` on `this` (the same monitor as `close()`) would fix both
issues.
<sub><i>- Generated by an AI agent and may contain mistakes. Please verify
any suggestions before applying.</i></sub>
--
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]