-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
8321718: ProcessTools.executeProcess calls waitFor before logging #17052
Conversation
👋 Welcome back stefank! A progress list of the required criteria for merging this PR into |
Webrevs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Thanks
@stefank This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 7 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
Thanks for reviewing! I'm considering removing the test before integrating, as it currently takes >8s to run and it was mainly used to show the difference between the implementations. Do you agree that it would be OK to remove the test? |
Sure that's fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello Stefan, these changes look good to me.
Like you note, the new test case in this PR, isn't needed, so can be removed.
Thanks for reviewing! I'll remove the test, merge, and will do some sanity checks before integrating. |
/integrate |
Going to push as commit 9ab29f8.
Your commit was automatically rebased without conflicts. |
There is some logging printed when tests spawns processes. This logging is triggered from calls to
OutputAnalyzer
, when it delegates calls toLazyOutputBuffer
.If we write code like this:
We get the following logging:
The first line comes from the
OutputAnalyzer
constructor and the two other lines comes from thegetExitValue
call, which calls logs the above messages around the call towaitFor
.If instead write the code above as:
We get the same logging, but timestamp1 and timestamp2 are almost the same. This happens because there's an extra call to
waitFor
insideexecuteProcess
, but thatwaitFor
does not have the "wait for" logging. So, instead we get the logging for the no-opwaitFor
insidegetExitValue
.I would like to propose a small workaround to solve this. The workaround is that
executeProcess
delegates thewaitFor
call to theLazyOutputBuffer
viaOutputAnalyzer
. This is a small, limited workaround for this issue. Ideally I would like to extract the entire Process handling code out of LazyOutputBuffer and OutputAnalyzer, but the prototype for that rewrites all usages ofnew OutputAnalyzer(pb.start())
and stretches far and wide in the test directories, so I'm starting out with this suggestion.We can see of this patch by looking at the timestamps generated from the included test. Without the proposed workaround:
Without
With the proposed workaround:
See how the timestamp for "Waiting for completion for process" becomes "earlier" in the "executeProcess" cases.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/17052/head:pull/17052
$ git checkout pull/17052
Update a local copy of the PR:
$ git checkout pull/17052
$ git pull https://git.openjdk.org/jdk.git pull/17052/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 17052
View PR using the GUI difftool:
$ git pr show -t 17052
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/17052.diff
Webrev
Link to Webrev Comment