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
8267666: Add option to jcmd GC.heap_dump to use existing file #4183
8267666: Add option to jcmd GC.heap_dump to use existing file #4183
Conversation
👋 Welcome back akozlov! A progress list of the required criteria for merging this PR into |
@AntonKozlov The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
/label serviceability |
@plummercj |
@AntonKozlov I thought there was recently a thread were you discussed this, but I can't find it. If there was one, can you include a link? Thanks. |
AFAIK such enhancement was not discussed before. Please consider this review request also as a start of a discussion. The implementation is rather small, so I thought it was not worth a separate CFD in advance. I added few details to the bug. The change does not depend on a particular operating system, but on Linux, for example, the new option allows sending the dump to the external LZ4 process. It provides a compressed dump of the heap 2x faster than it is possible now, at the speed comparable to writing uncompressed dump. Thanks! |
Hi @AntonKozlov, |
Moreover, it seems the /csr label is required |
A test is trivial. Just in case, I've added it.
Is the label really required? I don't see any integrated RFR with the label. I won't push this before CSR is approved anyway. Thanks! |
Hi Anton,
AFAIK, the BRs, |
/csr needed |
@AntonKozlov this pull request will not be integrated until the CSR request JDK-8267667 for issue JDK-8267666 has been approved. |
I think |
|
Hmm... it looks like the same result for the user between Let's see comments from other reviewers. |
Agree, I would like to hear more feedback. I still don't think we need to provide a (false) similarity with existing tools. For example:
|
I think the named pipe scenario needs more discussion. For the more simpler case of overwriting an existing file then opt-in in with an option like |
I would rename the option to And to really implement the overwrite semantics, the file should be opened with And on Unix it might be a good idea to use O_NOCTTY, so we don't accidentally assign a controlling tty when dumping to a console ('ve never seen actual problems omitting this, but it seems safe to add it). Even with this changes you can still write to a fifo/tty on Unix or a named pipe on Windows, since O_TRUNC is ignored for these types of files. And since you already created a CSR, I would propose to close JDK-8263066 and instead try to get this into the mainline. |
I have renamed the option to SInce JDK-8263066 suggests more enhancements, it may be worth keeping it to track the remaining ones. @AlanBateman The patch does not do anything special to the named pipe use-case, although makes it possible. Do you suggest removing mentions of the use-case from the CSR? Otherwise, what concerns could I address? Thanks! |
Yeah, I tjhink the O_NOCTTY is more a theoretical consideration. I've never seen problems in practice. |
No, the issue we're trying to solve with JDK-8263066 is basically the same as with JDK-8267666, so we'll close it. There's also JDK-8200579 which could be closed then.
I would suggest to change the CSR to use "overwrite" but other than that, it seems fine. Let's wait what Alan has to say but that would be my thinking. |
Right, thanks! Now it is fixed, CSR uses "overwrite". |
Using "-overwrite" to opt-in to overwrite an existing file looks good to me. The CSR still has wording to suggest that the new option is also to support socket/other files. I read the PR as just the overwrite existing file case. If so then maybe those (two) sentences can be changed in the CSR to make it clearer. |
Thanks Alan for commenting on that one.
I think it's ok to mention the use-cases like pipe support which is something that'll be enabled by this change. But feel free to remove it. I've marked the CSR as reviewed from my end. |
Thanks for the comments! Indeed, the change is about the "overwrite" option only. The CSR describes why the option is necessary, and sockets and pipes are just examples. I have rephrased CSR to be more explicit about the option, but not examples. |
Perfect, looks good to me. |
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 for the change.
@AntonKozlov This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
Please keep this open :) We're waiting for the CSR. @jddarcy, is there any update? |
@AntonKozlov 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 684 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
/integrate |
Going to push as commit 7cbb67a.
Your commit was automatically rebased without conflicts. |
@AntonKozlov Pushed as commit 7cbb67a. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Please review a small change that adds an option to GC.heap_dump to use an existing file.
The option is necessary if the target file is a predefined file-like object, like a named pipe. This opens up a lot of possibilities to process a heap dump without storing it to the file system first.
Reviews of the CSR linked to the bug would be appreciated as well.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4183/head:pull/4183
$ git checkout pull/4183
Update a local copy of the PR:
$ git checkout pull/4183
$ git pull https://git.openjdk.java.net/jdk pull/4183/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 4183
View PR using the GUI difftool:
$ git pr show -t 4183
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4183.diff