HTHou commented on PR #18999: URL: https://github.com/apache/iotdb/pull/18999#issuecomment-6410285114
@shuwenwei Thanks for checking the failure paths. Regarding the [double-close comment](https://github.com/apache/iotdb/pull/18999#issuecomment-6406549384), I checked both the sources and bytecode of the exact dependency used here, `org.apache.tsfile:tsfile:2.5.1-261023-SNAPSHOT`. `Chunk.close()` delegates to `EncryptParameter.close()`, which calls `destroy()`. That method guards the release as follows (`EncryptParameter.java:302–319`): ```java synchronized (this) { if (destroyed) { return; } destroyed = true; // ... } if (fileEncryptContext != null) { fileEncryptContext.release(); } ``` Also, `retain()` returns a distinct `EncryptParameter` instance sharing the underlying file context. Each retained instance has its own `destroyed` flag. So the constructor/registry cleanup and the loader's catch block can indeed both close the same chunk, but the second close does not decrement the shared reference count again. In this dependency version, repeated close is redundant cleanup; it does not over-release the context or invalidate other retained references. This addresses the double-close/reference-count claim specifically. Reusing an already-closed object during a retry is a separate ownership question. -- 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]
