zerolbsony commented on code in PR #18349:
URL: https://github.com/apache/iotdb/pull/18349#discussion_r3694204155
##########
iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/ratis/ApplicationStateMachineProxy.java:
##########
@@ -276,8 +277,9 @@ public long takeSnapshot() throws IOException {
private void deleteIncompleteSnapshot(File snapshotDir) throws IOException {
// this takeSnapshot failed, clean up files and directories
// statemachine is supposed to clear snapshotDir on failure
- boolean isEmpty = snapshotDir.delete();
- if (!isEmpty) {
+ try {
+ Files.deleteIfExists(snapshotDir.toPath());
+ } catch (DirectoryNotEmptyException e) {
Review Comment:
Resolved
--
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]