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

8268852: AsyncLogWriter should not overide is_Named_thread() #4503

Closed
wants to merge 1 commit into from

Conversation

navyxliu
Copy link
Member

@navyxliu navyxliu commented Jun 16, 2021

AsyncLogWriter is a subclass of NonJavaThread but not NamedThread. Therefore,
is_Named_thread() must not return true.

Testing:

  1. hardcrash scenario:
    ...
    Other Threads:
    0x00007f2870391f70 VMThread "VM Thread" [stack: 0x00007f2809d7d000,0x00007f2809e7d000] [id=76015]
    0x00007f28706a1d70 WatcherThread [stack: 0x00007f28082f0000,0x00007f28083f0000] [id=76033]
    0x00007f28702499b0 AsyncLog Thread [stack: 0x00007f2809e7f000,0x00007f2809f7f000] [id=76014]
    ...

  2. jcmd $pid Thread.print
    ...
    "AsyncLog Thread" os_prio=0 cpu=1015.24ms elapsed=181.04s tid=0x00007f7b14c57fb0 nid=0x12ed8 runnable
    ...


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8268852: AsyncLogWriter should not overide is_Named_thread()

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4503/head:pull/4503
$ git checkout pull/4503

Update a local copy of the PR:
$ git checkout pull/4503
$ git pull https://git.openjdk.java.net/jdk pull/4503/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4503

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4503.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 16, 2021

👋 Welcome back xliu! 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 openjdk bot added the rfr Pull request is ready for review label Jun 16, 2021
@openjdk
Copy link

openjdk bot commented Jun 16, 2021

@navyxliu 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 Jun 16, 2021
@mlbridge
Copy link

mlbridge bot commented Jun 16, 2021

Webrevs

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.

Seems fine.

Thanks for fixing.

David

Comment on lines +649 to +651
else if (this == AsyncLogWriter::instance()) {
st->print("%s", this->name());
} else { st->print("Thread"); }
Copy link
Member

Choose a reason for hiding this comment

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

This is a bit kludgy but then the whole name() handling is a mess - I will file a RFE to try and clean that up.

@openjdk
Copy link

openjdk bot commented Jun 16, 2021

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

8268852: AsyncLogWriter should not overide is_Named_thread()

Reviewed-by: dholmes, ysuenaga

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 master branch:

  • b836b83: 8259338: Add expiry exception for identrustdstx3 alias to VerifyCACerts.java test
  • c20f80a: 8259066: Obsolete -XX:+AlwaysLockClassLoader
  • e4908a4: 8268778: CDS check_excluded_classes needs DumpTimeTable_lock
  • 72b3b0a: 8267752: KVHashtable doesn't deallocate entries
  • af13fe1: 8267870: Remove unnecessary char_converter during class loading
  • 3ad6586: 8268078: ClassListParser::_interfaces should be freed
  • 48d4562: 8268780: Use 'print_cr' instead of 'print' for the message 'eliminated '

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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 (@dholmes-ora, @YaSuenag) 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 Jun 16, 2021
Copy link
Member

@YaSuenag YaSuenag left a comment

Choose a reason for hiding this comment

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

Looks good, but can we add is_AsyncLogWriter_thread() to Thread like is_ConcurrentGC_thread()?

@mlbridge
Copy link

mlbridge bot commented Jun 16, 2021

Mailing list message from David Holmes on hotspot-runtime-dev:

Hi Yasumasa,

On 16/06/2021 2:07 pm, Yasumasa Suenaga wrote:

On Wed, 16 Jun 2021 01:18:55 GMT, Xin Liu <xliu at openjdk.org> wrote:

AsyncLogWriter is a subclass of NonJavaThread but not NamedThread. Therefore,
is_Named_thread() must not return true.

Testing:

1. hardcrash scenario:
...
Other Threads:
0x00007f2870391f70 VMThread "VM Thread" [stack: 0x00007f2809d7d000,0x00007f2809e7d000] [id=76015]
0x00007f28706a1d70 WatcherThread [stack: 0x00007f28082f0000,0x00007f28083f0000] [id=76033]
0x00007f28702499b0 AsyncLog Thread [stack: 0x00007f2809e7f000,0x00007f2809f7f000] [id=76014]
...

2. jcmd $pid Thread.print
...
"AsyncLog Thread" os_prio=0 cpu=1015.24ms elapsed=181.04s tid=0x00007f7b14c57fb0 nid=0x12ed8 runnable
...

Looks good, but can we add `is_AsyncLogWriter_thread()` to `Thread` like `is_ConcurrentGC_thread()`?

I was going to suggest something similar but instead I've filed a RFE -
JDK-8268855 - that will get rid of that chunk of code anyway.

Cheers,
David
-----

1 similar comment
@mlbridge
Copy link

mlbridge bot commented Jun 16, 2021

Mailing list message from David Holmes on hotspot-runtime-dev:

Hi Yasumasa,

On 16/06/2021 2:07 pm, Yasumasa Suenaga wrote:

On Wed, 16 Jun 2021 01:18:55 GMT, Xin Liu <xliu at openjdk.org> wrote:

AsyncLogWriter is a subclass of NonJavaThread but not NamedThread. Therefore,
is_Named_thread() must not return true.

Testing:

1. hardcrash scenario:
...
Other Threads:
0x00007f2870391f70 VMThread "VM Thread" [stack: 0x00007f2809d7d000,0x00007f2809e7d000] [id=76015]
0x00007f28706a1d70 WatcherThread [stack: 0x00007f28082f0000,0x00007f28083f0000] [id=76033]
0x00007f28702499b0 AsyncLog Thread [stack: 0x00007f2809e7f000,0x00007f2809f7f000] [id=76014]
...

2. jcmd $pid Thread.print
...
"AsyncLog Thread" os_prio=0 cpu=1015.24ms elapsed=181.04s tid=0x00007f7b14c57fb0 nid=0x12ed8 runnable
...

Looks good, but can we add `is_AsyncLogWriter_thread()` to `Thread` like `is_ConcurrentGC_thread()`?

I was going to suggest something similar but instead I've filed a RFE -
JDK-8268855 - that will get rid of that chunk of code anyway.

Cheers,
David
-----

@YaSuenag
Copy link
Member

Looks good, but can we add is_AsyncLogWriter_thread() to Thread like is_ConcurrentGC_thread()?

I was going to suggest something similar but instead I've filed a RFE -
JDK-8268855 - that will get rid of that chunk of code anyway.

Sounds good, thanks!

@navyxliu
Copy link
Member Author

navyxliu commented Jun 16, 2021

Looks good, but can we add is_AsyncLogWriter_thread() to Thread like is_ConcurrentGC_thread()?

Thanks. I think that change is more "global" because we have to declare _AsyncLogWriter_thread() virtual.
AsyncLogWriter is singleton. We can always use this == _instance, which is faster. The only drawback is it doesn't support subclass. I don't intend to use as a base class.

@navyxliu
Copy link
Member Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Jun 16, 2021
@openjdk
Copy link

openjdk bot commented Jun 16, 2021

@navyxliu
Your change (at version 209377a) is now ready to be sponsored by a Committer.

@dholmes-ora
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Jun 16, 2021

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

  • b836b83: 8259338: Add expiry exception for identrustdstx3 alias to VerifyCACerts.java test
  • c20f80a: 8259066: Obsolete -XX:+AlwaysLockClassLoader
  • e4908a4: 8268778: CDS check_excluded_classes needs DumpTimeTable_lock
  • 72b3b0a: 8267752: KVHashtable doesn't deallocate entries
  • af13fe1: 8267870: Remove unnecessary char_converter during class loading
  • 3ad6586: 8268078: ClassListParser::_interfaces should be freed
  • 48d4562: 8268780: Use 'print_cr' instead of 'print' for the message 'eliminated '

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Jun 16, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and 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 Jun 16, 2021
@openjdk
Copy link

openjdk bot commented Jun 16, 2021

@dholmes-ora @navyxliu Pushed as commit 02c9bf0.

💡 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
3 participants