-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8274597: [TESTBUG] Two of the dnd tests times out and fails #5777
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
Conversation
|
👋 Welcome back mvs! A progress list of the required criteria for merging this PR into |
|
@manukumarvs 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. |
|
Looks like the hang occurs in some of the hook executed at the "exit" step. DId you check which ShutdownHook is executed and hang? Is it possible it is some of the AWT toolkit related? |
|
@mrserb I can see three non-daemon threads in 'WAITING' state(given below). So looks like 'AWT-Shutdown' thread created by AWTAutoShutdown.java is the hook which is getting blocked. But I think this is an expected behaviour only as it will block this thread until all AWT tasks are complete. "main" #1 prio=5 os_prio=0 cpu=78.13ms elapsed=240.13s tid=0x0000017129532000 nid=0x1518 in Object.wait() [0x0000001fb8ffe000] "AWT-Shutdown" #24 prio=5 os_prio=0 cpu=0.00ms elapsed=239.97s tid=0x000001714cd43800 nid=0x29c4 in Object.wait() [0x0000001fba6fe000] "AWT-EventQueue-0" #27 prio=6 os_prio=0 cpu=109.38ms elapsed=239.96s tid=0x000001714d006800 nid=0x1f70 waiting on condition [0x0000001fba8fe000] |
This issue is unrelated to the non-daemon threads since the System.exit() is called, it should exit the whole JVM. But before exit it executes some number of registered ShutdownHook, we need to check what ShutdownHook is executed and why it hangs. The AWT-Shutdown is not a hook, it is a thread which prevents vm exit if there are some UI peers, but it does ont prevent the System.exit(). |
@mrserb I can see only two shutdown hooks registered, Thread[ToolkitShutdown,6,system] and Thread[ScreenUpdater,6,system]. But I don't know which one of this is getting hanged, any idea how can I check it?. Also if we put a Thread.sleep(100) or just a System.out.println() at the end of the main(), its not hanging and the tests are passing. |
You can add logging to each of them and check, or you can debug the native code.
maybe the test found a deadlock in the product and you just workaround it?
The algorithm to use in such cases is something like this:
|
|
@manukumarvs 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! |
|
@manukumarvs This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the |
These two dnd tests fails most of the time with a time out, mostly noticed in windows 11 machines.
Fix:
From the logs, I have noticed that some of the non-daemon threads are still waiting even after the test execution is complete. So it could be possible that java is waiting for these threads to be finished execution before the main thread exits.
As a fix for this, I have put a Thread.sleep(100) at the end of the main() in order to enable other non-daemon threads get a chance to finish their execution before the main thread completes.
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/5777/head:pull/5777$ git checkout pull/5777Update a local copy of the PR:
$ git checkout pull/5777$ git pull https://git.openjdk.java.net/jdk pull/5777/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 5777View PR using the GUI difftool:
$ git pr show -t 5777Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/5777.diff