Skip to content

Commit

Permalink
Ignore errors syncing ephemeral files in test clusters (#82154) (#82223)
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-vieira authored Jan 4, 2022
1 parent 49fb505 commit 8684b76
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
import java.io.UncheckedIOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.NoSuchFileException;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.nio.file.StandardOpenOption;
Expand Down Expand Up @@ -1207,11 +1208,6 @@ private void sync(Path sourceRoot, Path destinationRoot, BiConsumer<Path, Path>
throw new UncheckedIOException("Can't create directory " + destination.getParent(), e);
}
} else {
// Ignore these files that are sometimes let behind by the JVM
if (relativeDestination.toFile().getName().startsWith(".attach_pid")) {
return;
}

try {
Files.createDirectories(destination.getParent());
} catch (IOException e) {
Expand All @@ -1220,6 +1216,11 @@ private void sync(Path sourceRoot, Path destinationRoot, BiConsumer<Path, Path>
syncMethod.accept(destination, source);
}
});
} catch (NoSuchFileException e) {
// Ignore these files that are sometimes left behind by the JVM
if (e.getFile() == null || e.getFile().contains(".attach_pid") == false) {
throw new UncheckedIOException(e);
}
} catch (IOException e) {
throw new UncheckedIOException("Can't walk source " + sourceRoot, e);
}
Expand Down

0 comments on commit 8684b76

Please sign in to comment.