imbajin commented on code in PR #3461:
URL: https://github.com/apache/hugegraph/pull/3461#discussion_r4505040543


##########
hugegraph-server/hugegraph-rocksdb/src/main/java/org/apache/hugegraph/backend/store/rocksdbsst/RocksDBSstSessions.java:
##########
@@ -203,14 +203,18 @@ protected Session newSession() {
 
     @Override
     protected synchronized void doClose() {
-        final String NO_ENTRIES = "Can't create sst file with no entries";
+        // RocksDB reports "Cannot create sst file with no entries"
+        final String NO_ENTRIES = "create sst file with no entries";
 
         for (SstFileWriter sst : this.tables.values()) {
             E.checkState(sst.isOwningHandle(), "SstFileWriter closed");
             try {
                 sst.finish();
             } catch (RocksDBException e) {
-                if (e.getMessage().equals(NO_ENTRIES)) {
+                String message = e.getMessage();
+                if (message != null && message.contains(NO_ENTRIES)) {

Review Comment:
   ⚠️ **Important:** For a non-empty-table `finish()` failure, the exception 
path still exits before closing this writer or the remaining writers. The 
session close may not retry cleanup, so native handles can remain open. Please 
attempt to close every writer on failure and preserve the original exception, 
with regression coverage.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to