Re: [OpenJDK 2D-Dev] RFR: 8197825: [Test] Intermiitent timeout with javax/swing JColorChooser Test [v3]
On Mon, 25 Jan 2021 15:09:35 GMT, Alexey Ivanov wrote: > Yet I suggest fixing the typo in the bug synopsis: Intermiitent → Intermittent I've edited the JBS synopsis. Please also update the PR subject. - PR: https://git.openjdk.java.net/jdk/pull/2220
Re: [OpenJDK 2D-Dev] RFR: 8197825: [Test] Intermiitent timeout with javax/swing JColorChooser Test [v3]
On Fri, 29 Jan 2021 04:03:29 GMT, Prasanta Sadhukhan wrote: > It seems "m_breakMessageLoop" is never true for unsuccessful run even though > AwtToolkit::QuitMessageLoop finish execution (where m_breakMessageLoop is set > to true), > so AwtToolkit::MessageLoop never ends and shutdown hook gets called where > tk.isDisposed() loop start spinning. seems to be some timing issue. Then this does look like a synchronisation problem. One thread changes the value of `m_breakMessageLoop` but another doesn't see it's changed. Should `m_breakMessageLoop` be declared as `volatile`? - PR: https://git.openjdk.java.net/jdk/pull/2220
Re: [OpenJDK 2D-Dev] RFR: 8197825: [Test] Intermiitent timeout with javax/swing JColorChooser Test [v3]
On Thu, 28 Jan 2021 19:50:56 GMT, Sergey Bylokhov wrote: >>> >>> My point is that this is not a test bug, so the test should not be changed. >> >> The test never dispose of the frame. Why is it expected to shut down the >> toolkit? Shall the frame be disposed of when the main thread in the test >> finishes? > >> The test never dispose of the frame. Why is it expected to shut down the >> toolkit? Shall the frame be disposed of when the main thread in the test >> finishes? > > The shutdown is caused by the System.exit call while the toolkit active, so > we should shut down it before the end. It seems "m_breakMessageLoop" is never true for unsuccessful run even though AwtToolkit::QuitMessageLoop finish execution (where m_breakMessageLoop is set to true), so AwtToolkit::MessageLoop never ends, seems to be some timing issue. - PR: https://git.openjdk.java.net/jdk/pull/2220
Re: [OpenJDK 2D-Dev] RFR: 8197825: [Test] Intermiitent timeout with javax/swing JColorChooser Test [v3]
On Thu, 28 Jan 2021 12:02:54 GMT, Alexey Ivanov wrote: > The test never dispose of the frame. Why is it expected to shut down the > toolkit? Shall the frame be disposed of when the main thread in the test > finishes? The shutdown is caused by the System.exit call while the toolkit active, so we should shut down it before the end. - PR: https://git.openjdk.java.net/jdk/pull/2220
Re: [OpenJDK 2D-Dev] RFR: 8197825: [Test] Intermiitent timeout with javax/swing JColorChooser Test [v3]
On Thu, 28 Jan 2021 11:57:06 GMT, Alexey Ivanov wrote: >> It seems in successful run, when the test finish >> - AwtToolkit::MessageLoop starts >> - DoQuitMessageLoop is called >> - AwtToolkit::QuitMessageLoop starts >> - AwtToolkit::QuitMessageLoop finishes >> - AwtToolkit::MessageLoop finish >> - Dispose() is called, m_isDisposed sets to true >> - shutdown hook isDisposed is true so no infinite loop >> >> During unsuccessful run, >> - AwtToolkit::MessageLoop starts >> - DoQuitMessageLoop is called >> - AwtToolkit::QuitMessageLoop starts >> - AwtToolkit::QuitMessageLoop finishes >> - AwtToolkit::MessageLoop NEVER ends so Dispose() is not called so >> m_isDisposed is not set to true so shutdown hook goes in infinite loop. > > I was looking at the code yesterday. Could it be because of synchronisation? > I mean, do we need to use native synchronisation to guarantee variable > changes are seen across the threads? > > Does MessageLoop not receive Quit / Null message? > > My point is that this is not a test bug, so the test should not be changed. The test never dispose of the frame. Why is it expected to shut down the toolkit? Shall the frame be disposed of when the main thread in the test finishes? - PR: https://git.openjdk.java.net/jdk/pull/2220
Re: [OpenJDK 2D-Dev] RFR: 8197825: [Test] Intermiitent timeout with javax/swing JColorChooser Test [v3]
On Thu, 28 Jan 2021 09:59:22 GMT, Prasanta Sadhukhan wrote: >> Please take a look at the "AwtToolkit::Dispose()" method, on how much stuff >> should be done to properly shutdown the toolkit. This Dispose() method is >> executed immediately when we exit the message loop in the >> "Java_sun_awt_windows_WToolkit_eventLoop". So when the shutdown hook is >> executed we should have the message loop, then we call tk.QuitMessageLoop to >> stop it, and wait until all code in the Dispose() is executed. But since the >> IsDisposed() return false we for unknow reason hang, does it mean that the >> message loop still operates? Or we got some error during "QuitMessageLoop"? > > It seems in successful run, when the test finish > - AwtToolkit::MessageLoop starts > - DoQuitMessageLoop is called > - AwtToolkit::QuitMessageLoop starts > - AwtToolkit::QuitMessageLoop finishes > - AwtToolkit::MessageLoop finish > - Dispose() is called, m_isDisposed sets to true > - shutdown hook isDisposed is true so no infinite loop > > During unsuccessful run, > - AwtToolkit::MessageLoop starts > - DoQuitMessageLoop is called > - AwtToolkit::QuitMessageLoop starts > - AwtToolkit::QuitMessageLoop finishes > - AwtToolkit::MessageLoop NEVER ends so Dispose() is not called so > m_isDisposed is not set to true so shutdown hook goes in infinite loop. I was looking at the code yesterday. Could it be because of synchronisation? I mean, do we need to use native synchronisation to guarantee variable changes are seen across the threads? Does MessageLoop not receive Quit / Null message? - PR: https://git.openjdk.java.net/jdk/pull/2220
Re: [OpenJDK 2D-Dev] RFR: 8197825: [Test] Intermiitent timeout with javax/swing JColorChooser Test [v3]
On Thu, 28 Jan 2021 05:53:05 GMT, Sergey Bylokhov wrote: >> My point is that this is not a test bug, so the test should not be changed. > > Please take a look at the "AwtToolkit::Dispose()" method, on how much stuff > should be done to properly shutdown the toolkit. This Dispose() method is > executed immediately when we exit the message loop in the > "Java_sun_awt_windows_WToolkit_eventLoop". So when the shutdown hook is > executed we should have the message loop, then we call tk.QuitMessageLoop to > stop it, and wait until all code in the Dispose() is executed. But since the > IsDisposed() return false we for unknow reason hang, does it mean that the > message loop still operates? Or we got some error during "QuitMessageLoop"? It seems in successful run, when the test finish - AwtToolkit::MessageLoop starts - DoQuitMessageLoop is called - AwtToolkit::QuitMessageLoop starts - AwtToolkit::QuitMessageLoop finishes - AwtToolkit::MessageLoop finish - Dispose() is called, m_isDisposed sets to true - shutdown hook isDisposed is true so no infinite loop During unsuccessful run, - AwtToolkit::MessageLoop starts - DoQuitMessageLoop is called - AwtToolkit::QuitMessageLoop starts - AwtToolkit::QuitMessageLoop finishes - AwtToolkit::MessageLoop NEVER ends so Dispose() is not called so m_isDisposed is not set to true so shutdown hook goes in infinite loop. - PR: https://git.openjdk.java.net/jdk/pull/2220
Re: [OpenJDK 2D-Dev] RFR: 8197825: [Test] Intermiitent timeout with javax/swing JColorChooser Test [v3]
On Thu, 28 Jan 2021 00:41:13 GMT, Sergey Bylokhov wrote: >> src/java.desktop/windows/native/libawt/windows/awt_Toolkit.cpp line 2611: >> >>> 2609: Sleep(100); >>> 2610: } >>> 2611: >> >> It can cause infinite looping as the message queue to get DISPOSE events is >> removed so if we are not getting disposed by now, we probably will not get >> DISPOSE event ever causing infinite loop. >> XToolkit, LWToolkit does not have this infinite loop. > > My point is that this is not a test bug, so the test should not be changed. Please take a look at the "AwtToolkit::Dispose()" method, on how much stuff should be done to properly shutdown the toolkit. This Dispose() method is executed immediately when we exit the message loop in the "Java_sun_awt_windows_WToolkit_eventLoop". So when the shutdown hook is executed we should have the message loop, then we call tk.QuitMessageLoop to stop it, and wait until all code in the Dispose() is executed. But since the IsDisposed() return false we for unknow reason hang, does it mean that the message loop still operates? Or we got some error during "QuitMessageLoop"? - PR: https://git.openjdk.java.net/jdk/pull/2220
Re: [OpenJDK 2D-Dev] RFR: 8197825: [Test] Intermiitent timeout with javax/swing JColorChooser Test [v3]
> This test was failing in our nightly mach5 testing. Appropriate stability > code in form of waitForIdle and delay is added. > mach5 job running for several iterations on all platforms is ok. Link in JBS. Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: Test changes reverted - Changes: - all: https://git.openjdk.java.net/jdk/pull/2220/files - new: https://git.openjdk.java.net/jdk/pull/2220/files/87d371ad..6fdcc0d7 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk=2220=02 - incr: https://webrevs.openjdk.java.net/?repo=jdk=2220=01-02 Stats: 32 lines in 1 file changed: 0 ins; 12 del; 20 mod Patch: https://git.openjdk.java.net/jdk/pull/2220.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2220/head:pull/2220 PR: https://git.openjdk.java.net/jdk/pull/2220