On Mon, 1 Aug 2022 21:25:09 GMT, Serguei Spitsyn <sspit...@openjdk.org> wrote:

> This looks okay to me.
> However, it can be still unreliable.
> Is there a way to check-wait for the expected class unload events?

The debuggee would need to block until the debugger says it got all the events. 
Currently the debugger just runs until it gets a VMDeathEvent, then it checks 
if got the expected ClassUnloadEvents. So it would instead have to wait until 
it got all the expected ClassUnloadEvents (and time out eventually if not). It 
would also need to communicate with the debuggee. I don't think any of 
com/sun/jdi tests currently do this. Possibly we could setup a breakpoint in 
the debuggee after doing the GC, and have the debugger not resume it until 
after it gets all the expected events. I just felt doing a short sleep was so 
much easier, especially given that we aren't 100% sure the early VMDeathEvent 
is the cause of this issue. At the very least it would be nice to see if this 
simple solution is fixing the problem.

-------------

PR: https://git.openjdk.org/jdk/pull/9708

Reply via email to