-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
8338894: Deprecate jhsdb debugd for removal #20830
Conversation
👋 Welcome back kevinw! A progress list of the required criteria for merging this PR into |
@kevinjwalls 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 73 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 |
@kevinjwalls 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. |
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HotSpotAgent.java: src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/SALauncher.java: src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/DebugServer.java: Handle man page in a separate issue.
Additionally, update the html docs with the same warning: |
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.
I can look at the CSR when it is ready.
OK one other addition, as jhsdb debugd and the --connect option are two sides of the same feature: We generally expect attaches between the same JDK version (see the SA version mismatch warning), We can warn at the tool running with --connect, e.g.
In our own tests, the debugd warning message causes no problems, but the warning on using --connect causes some test disruption, will update. |
I agree it doesn't make sense. For the warning message it might be clearer to put the tool name into the message, as in something like "WARNING: jhsdb jstack --connect is deprecated ..."). The reason is that someone using "jhsdb jstack --connect" is not running the "debugd" command so would be confusing to get that in the message. |
Co-authored-by: Chris Plummer <chris.plummer@oracle.com>
Co-authored-by: Chris Plummer <chris.plummer@oracle.com>
@@ -69,6 +69,8 @@ private static boolean commonHelp(String mode, boolean canConnectToRemote) { | |||
System.out.println(" --exe <executable for corefile>"); | |||
if (canConnectToRemote) { | |||
System.out.println(" --connect [<serverid>@]<host>[:registryport][/servername] To connect to a remote debug server (debugd)."); | |||
System.out.println(); | |||
System.out.println("WARNING: debugd (and therefore --connect) are deprecated and will be removed in a future release."); |
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.
This is -help output so I assume should be "The --connect option is deprecated and will be removed in a future release".
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.
Can you paste in up to date examples of the output from jhsdb debugd ..
and `jhsdb jstack --connect .." so we can see the warnings. The output is in the first comment has warnings in the --help output, and there isn't an example using --connect that I think we need to review properly.
Updated, including tests as the new --connect warning needs to be ignored. Alan you mention "warnings in the --help output", I still have a warning in the middle of the help text here, I tried it elsewhere but liked having the warning about --connect next to where --connect is mentioned in the help. It seems like unnecessary additional changes would be needed to enable the common argument helper method to know what command is being invoked to make the --connect message specific to jhsdb jstack --connect etc. Also one message to check for in tests. Updated messages:
|
@@ -69,6 +69,8 @@ private static boolean commonHelp(String mode, boolean canConnectToRemote) { | |||
System.out.println(" --exe <executable for corefile>"); | |||
if (canConnectToRemote) { | |||
System.out.println(" --connect [<serverid>@]<host>[:registryport][/servername] To connect to a remote debug server (debugd)."); | |||
System.out.println(); | |||
System.err.println("WARNING: --connect is deprecated and will be removed in a future release."); |
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.
This is jhsdb $TOOL --help
output. Shouldn't this just have "(deprecated)" before "To connect ..." rather than a blank line and warning? I assume the changes should only print "WARNING" if the user attempts to run jhsdb $TOOL -connect ..
.
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.
OK yes understood, we can keep things less ALARMING unless you try and use the options.
--connect is already a long line, so adding "(deprecated)" I think gets lost. We can do:
bash-4.2$ build/linux-x64/images/jdk/bin/jhsdb jstack --help
--locks To print java.util.concurrent locks.
--mixed To print both Java and native frames (mixed mode).
--pid <pid> To attach to and operate on the given live process.
--core <corefile> To operate on the given core file.
--exe <executable for corefile>
--connect [<serverid>@]<host>[:registryport][/servername] To connect to a remote debug server (debugd).
The --connect option is deprecated and will be removed in a future release.
The --core and --exe options must be set together to give the core
file, and associated executable, to operate on. They can use
absolute or relative paths.
The --pid option can be set to operate on a live process.
The --connect option can be set to connect to a debug server (debugd).
--core, --pid, and --connect are mutually exclusive.
Examples: jhsdb jstack --pid 1234
or jhsdb jstack --core ./core.1234 --exe ./myexe
or jhsdb jstack --connect serverid@debugserver:1234/servername
bash-4.2$
Actually the text "The --connect option can be set to connect to a debug server (debugd)." is in there twice. Will remove the second one.
I had added a comment before seeing your latest update. My view is that it would be better to only print "WARNING" when the user tried to use a deprecated command/option. In the help output it can show that the command/option is deprecated but blank line + WARNING in the help looks a bit unusual (to me anyway). |
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.
The WARNING and help output look okay now.
Thanks, have updated CSR also. |
test/hotspot/jtreg/serviceability/sa/sadebugd/ClhsdbTestConnectArgument.java
Outdated
Show resolved
Hide resolved
test/hotspot/jtreg/serviceability/sa/sadebugd/ClhsdbTestConnectArgument.java
Outdated
Show resolved
Hide resolved
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. Make sure you get good test coverage of you OutputAnalyzer change.
That was the right thing to say, as I didn't have it quite right. stderrShouldBeEmptyIgnoreDeprecatedWarnings() needs to work if both kinds of deprecation message occurred. 8-) |
/integrate |
Going to push as commit 3352522.
Your commit was automatically rebased without conflicts. |
@kevinjwalls Pushed as commit 3352522. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Deprecation annotations and warnings on starting the tool(s).
Handle man page in a separate issue.
Progress
Issues
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/20830/head:pull/20830
$ git checkout pull/20830
Update a local copy of the PR:
$ git checkout pull/20830
$ git pull https://git.openjdk.org/jdk.git pull/20830/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 20830
View PR using the GUI difftool:
$ git pr show -t 20830
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/20830.diff
Webrev
Link to Webrev Comment