Skip to content

Commit 2404cdb

Browse files
committed
Fix the temp location manager on J9
(due to a different mechanism to retrieve running JVM processes)
1 parent f438c9e commit 2404cdb

File tree

1 file changed

+2
-1
lines changed
  • dd-java-agent/agent-profiling/profiling-controller/src/main/java/com/datadog/profiling/controller

1 file changed

+2
-1
lines changed

dd-java-agent/agent-profiling/profiling-controller/src/main/java/com/datadog/profiling/controller/TempLocationManager.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs)
107107
// the JFR repository directories are under <basedir>/pid_<pid>
108108
String pid = fileName.startsWith("pid_") ? fileName.substring(4) : null;
109109
boolean isSelfPid = pid != null && pid.equals(PidHelper.getPid());
110-
shouldClean |= (cleanSelf && isSelfPid) || (!cleanSelf && !pidSet.contains(pid));
110+
shouldClean |=
111+
(cleanSelf && isSelfPid) || (!cleanSelf && !isSelfPid && !pidSet.contains(pid));
111112
if (shouldClean) {
112113
log.debug("Cleaning temporary location {}", dir);
113114
}

0 commit comments

Comments
 (0)