Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
package jdk.jfr.internal.consumer;

import java.io.IOException;
import java.nio.file.DirectoryIteratorException;
import java.nio.file.DirectoryStream;
import java.nio.file.Path;
import java.nio.file.attribute.FileTime;
Expand Down Expand Up @@ -100,12 +101,11 @@ private boolean updatePaths(boolean wait) {
if (updatePaths()) {
break;
}
} catch (IOException e) {
Logger.log(LogTag.JFR_SYSTEM_STREAMING, LogLevel.DEBUG, "IOException during repository file scan " + e.getMessage());
} catch (IOException | DirectoryIteratorException e) {
Logger.log(LogTag.JFR_SYSTEM_STREAMING, LogLevel.DEBUG, "Exception during repository file scan " + e.getMessage());
// This can happen if a chunk is being removed
// between the file was discovered and an instance
// was accessed, or if new file has been written yet
// Just ignore, and retry later.
// was accessed. Just ignore, and retry later.
}
if (wait) {
nap();
Expand All @@ -131,7 +131,7 @@ public Path nextPath(long startTimeNanos, boolean wait) {
// Update paths
try {
updatePaths();
} catch (IOException e) {
} catch (IOException | DirectoryIteratorException e) {
// ignore
}
// try to get the next file
Expand Down Expand Up @@ -167,7 +167,7 @@ private void nap() {
}
}

private boolean updatePaths() throws IOException {
private boolean updatePaths() throws IOException, DirectoryIteratorException {
boolean foundNew = false;
Path repoPath = repository;

Expand Down Expand Up @@ -254,7 +254,7 @@ private Path findSubDirectory(Path repoPath) {
}
}
}
} catch (IOException e) {
} catch (IOException | DirectoryIteratorException e) {
// Ignore
}
return latestPath;
Expand Down