madrob commented on a change in pull request #544:
URL: https://github.com/apache/solr/pull/544#discussion_r788256229
##########
File path: solr/core/src/java/org/apache/solr/update/UpdateLog.java
##########
@@ -2133,18 +2132,18 @@ public static AddUpdateCommand
convertTlogEntryToAddUpdateCommand(SolrQueryReque
new SolrNamedThreadFactory("recoveryExecutor"));
- public static void deleteFile(File file) {
+ public static void deleteFile(Path file) {
boolean success = false;
try {
- Files.deleteIfExists(file.toPath());
+ Files.deleteIfExists(file);
success = true;
} catch (Exception e) {
log.error("Error deleting file: {}", file, e);
}
if (!success) {
try {
- file.deleteOnExit();
+ file.toFile().deleteOnExit();
Review comment:
There's not a deleteOnExit API for NIO. The options are to either
convert to a File or register our own shutdown hooks (which is what this does
behind the scenes). I think this code exists specifically for Windows running
with an AV (or the test FileSystem that simulates this) so I'm not sure what
the other replacement options are.
--
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]