RFR: 8294402: Add diagnostic logging to VMProps.checkDockerSupport [v4]
David Holmes
dholmes at openjdk.org
Wed Feb 1 04:46:52 UTC 2023
On Wed, 1 Feb 2023 03:47:14 GMT, Mikhailo Seledtsov <mseledtsov at openjdk.org> wrote:
>> Add log() and logToFile() methods to VMProps for diagnostic purposes.
>
> Mikhailo Seledtsov has updated the pull request incrementally with one additional commit since the last revision:
>
> Review feedback: printing stdout and stderr files to log()
test/jtreg-ext/requires/VMProps.java line 519:
> 517: private String redirectOutputToLogFile(String msg, ProcessBuilder pb, String fileNameBase) {
> 518: if (!Boolean.getBoolean("jtreg.log.vmprops")) {
> 519: return "";
I think having to explicitly enable this somewhat defeats the purpose of using it for diagnostics. If we get an unexpected failure we will have to reproduce it with logging enabled to see what went wrong.
test/jtreg-ext/requires/VMProps.java line 542:
> 540: try {
> 541: Files.lines(Path.of(logFileNames.split(",")[0]))
> 542: .forEach(line -> log(line));
Nit: style convention is to align '.' in stream operations
test/jtreg-ext/requires/VMProps.java line 568:
> 566:
> 567: log(String.format("checkDockerSupport(): exitValue = %s, pid = %s", exitValue, p.pid()));
> 568: printLogfileContent(logFileNames);
If we are concerned there may be too much output then I'd make this logging conditional on the process failing.
-------------
PR: https://git.openjdk.org/jdk/pull/12239
More information about the hotspot-dev
mailing list