Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[raydp-321] Prepend ":job_id:<jobid>" to java-worker-<jobid>-<pid>.log to avoid too many executor logs flushed to shell console #323

Merged
merged 2 commits into from
Mar 31, 2023
Merged
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
8 changes: 8 additions & 0 deletions core/agent/src/main/java/org/apache/spark/raydp/Agent.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.slf4j.LoggerFactory;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintStream;
import java.lang.instrument.Instrumentation;
Expand Down Expand Up @@ -68,5 +69,12 @@ public static void premain(String agentArgs, Instrumentation inst)
System.setErr(DEFAULT_ERR_PS);
System.setOut(DEFAULT_OUT_PS);
}
String jobId = System.getenv("RAY_JOB_ID");
String rayAddress = System.getProperty("ray.address");
if (jobId != null && rayAddress != null) {
try (FileWriter writer = new FileWriter(logDir + "/java-worker-" + jobId + "-" + pid + ".log")) {
writer.write(":job_id:" + jobId + "\n");
}
}
}
}