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

8327410: Add hostname option for UL file names #18153

Conversation

fbredber
Copy link
Contributor

@fbredber fbredber commented Mar 7, 2024

Added %hn as way to make the Unified Logging file name include the host name.
This is done in line with the already existing %p for pid, and %t for time stamp.

Also the %hn decorator is already used to prepend the host name to each log line. See: The JDK-8148219.

Example: java -Xlog:gc+init:file=frbr_%hn.%p.%t.log -version

Tested tier1-tier5.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8327410: Add hostname option for UL file names (Enhancement - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/18153/head:pull/18153
$ git checkout pull/18153

Update a local copy of the PR:
$ git checkout pull/18153
$ git pull https://git.openjdk.org/jdk.git pull/18153/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 18153

View PR using the GUI difftool:
$ git pr show -t 18153

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/18153.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 7, 2024

👋 Welcome back fbredberg! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Mar 7, 2024

@fbredber The following label will be automatically applied to this pull request:

  • hotspot-runtime

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.

@openjdk openjdk bot added the hotspot-runtime hotspot-runtime-dev@openjdk.org label Mar 7, 2024
@fbredber fbredber marked this pull request as ready for review March 7, 2024 15:17
@openjdk openjdk bot added the rfr Pull request is ready for review label Mar 7, 2024
@mlbridge
Copy link

mlbridge bot commented Mar 7, 2024

Webrevs

Copy link
Contributor

@jdksjolen jdksjolen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Fredrik,

I'm sorry but I think this needs some changes :-). This PR saves the hostname regardless if the hostname is requrested as part of the log filename or not. This means that the hostname is present in the heap of the JVM process, but I believe that the hostname should be considered confidential data. We should really only get the hostname if the user explicitly requests this.

@dholmes-ora , could you confirm whether what I'm saying is correct or not?

Also, we will be needing a man page update on this, which is separate to the usual PR process.

Thanks for doing this work!
Johan

@dholmes-ora
Copy link
Member

We should really only get the hostname if the user explicitly requests this.

Yes I agree. The existing use of hostname in UL only comes into play if that decorator is requested; and error reporting only includes hostname in debug builds due to its sensitive nature.

@fbredber
Copy link
Contributor Author

fbredber commented Mar 8, 2024

@jdksjolen , @dholmes-ora
Thanks for comments. We now only get the host name if the user explicitly requests it.
I also added the missing documentation to java -Xlog:help.

Copy link
Contributor

@jdksjolen jdksjolen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple which I'd like to have fixed, but otherwise LGTM. Will send approval after those two are fixed.

src/hotspot/share/logging/logFileOutput.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@jdksjolen jdksjolen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM,

thank you Fredrik for taking this on.

@openjdk
Copy link

openjdk bot commented Mar 8, 2024

@fbredber 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:

8327410: Add hostname option for UL file names

Reviewed-by: jsjolen, dholmes

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 36 new commits pushed to the master branch:

  • 21867c9: 8313332: Simplify lazy jmethodID cache in InstanceKlass
  • b9da140: 8329594: G1: Consistent Titles to Thread Work Items.
  • a169c06: 8329580: Parallel: Remove VerifyObjectStartArray
  • 8efd7aa: 8328786: [AIX] move some important warnings/errors from trcVerbose to UL
  • f26e430: 8327110: Refactor create_bool_from_template_assertion_predicate() to separate class and fix identical cloning cases used for Loop Unswitching and Split If
  • e5e21a8: 8328702: C2: Crash during parsing because sub type check is not folded
  • f762637: 8326962: C2 SuperWord: cache VPointer
  • 2931458: 8328938: C2 SuperWord: disable vectorization for large stride and scale
  • 4196688: 8329494: Serial: Merge GenMarkSweep into MarkSweep
  • 8020183: 8329470: Remove obsolete CDS SharedStrings tests
  • ... and 26 more: https://git.openjdk.org/jdk/compare/ed821cbe857363e049f3c640ae4546c340a577ac...master

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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@jdksjolen, @dholmes-ora) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Mar 8, 2024
@fbredber
Copy link
Contributor Author

fbredber commented Apr 3, 2024

@dholmes-ora
Is this PR approvable, or do you have more comments?

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @fbredber this one dropped off my radar. Nothing further from me. Changes look good.

Thanks

@fbredber
Copy link
Contributor Author

fbredber commented Apr 4, 2024

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Apr 4, 2024
@openjdk
Copy link

openjdk bot commented Apr 4, 2024

@fbredber
Your change (at version 0b8a619) is now ready to be sponsored by a Committer.

@JesperIRL
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Apr 4, 2024

Going to push as commit f3db279.
Since your change was applied there have been 36 commits pushed to the master branch:

  • 21867c9: 8313332: Simplify lazy jmethodID cache in InstanceKlass
  • b9da140: 8329594: G1: Consistent Titles to Thread Work Items.
  • a169c06: 8329580: Parallel: Remove VerifyObjectStartArray
  • 8efd7aa: 8328786: [AIX] move some important warnings/errors from trcVerbose to UL
  • f26e430: 8327110: Refactor create_bool_from_template_assertion_predicate() to separate class and fix identical cloning cases used for Loop Unswitching and Split If
  • e5e21a8: 8328702: C2: Crash during parsing because sub type check is not folded
  • f762637: 8326962: C2 SuperWord: cache VPointer
  • 2931458: 8328938: C2 SuperWord: disable vectorization for large stride and scale
  • 4196688: 8329494: Serial: Merge GenMarkSweep into MarkSweep
  • 8020183: 8329470: Remove obsolete CDS SharedStrings tests
  • ... and 26 more: https://git.openjdk.org/jdk/compare/ed821cbe857363e049f3c640ae4546c340a577ac...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Apr 4, 2024
@openjdk openjdk bot closed this Apr 4, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Apr 4, 2024
@openjdk
Copy link

openjdk bot commented Apr 4, 2024

@JesperIRL @fbredber Pushed as commit f3db279.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

4 participants