wenbingshen commented on PR #3965:
URL: https://github.com/apache/bookkeeper/pull/3965#issuecomment-1561389999
> > When the DefaultEntryLogger fails to delete the entryLogFile, it will
still clear the corresponding entryLogId from the entryLogMetaMap.
>
> For this part, I have noticed that it has already been covered.
@horizonzy No, the previous logic, when the file deletion fails, the method
will always return true.
```
public boolean removeEntryLog(long entryLogId) {
removeFromChannelsAndClose(entryLogId);
File entryLogFile;
try {
entryLogFile = findFile(entryLogId);
} catch (FileNotFoundException e) {
LOG.error("Trying to delete an entryLog file that could not be
found: "
+ entryLogId + ".log");
return false;
}
if (!entryLogFile.delete()) {
LOG.warn("Could not delete entry log file {}", entryLogFile);
<== here always return true
}
return true;
}
```
--
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]