RFR: 8355453: nsk.share.jdi.Debugee.waitingEvent() does not timeout properly [v2]

Serguei Spitsyn sspitsyn at openjdk.org
Mon Apr 28 23:38:50 UTC 2025


On Fri, 25 Apr 2025 06:17:38 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:

>> nsk.share.jdi.Debugee.waitingEvent() takes a timeout argument. However, if the call to EventQueue.remove() times out and returns null, waitingEvent() just keep on retrying. The logic is incorrect for a null result. It should immediately return null. The retry path is only meant for filtering out other events, and it updates "timeLeft' before retrying to avoid endlessly repeating the loop. 
>> 
>> Tested by running all of nsk/jdi locally on linux-x64-debug
>
> Chris Plummer has updated the pull request incrementally with one additional commit since the last revision:
> 
>   return null instead of throwing an exception

test/hotspot/jtreg/vmTestbase/nsk/share/jdi/Debugee.java line 463:

> 461:             EventSet eventSet = eventQueue.remove(timeLeft);
> 462:             if (eventSet == null) {
> 463:                 return null;

This does not match the comment at the line 438:

     * Wait for the requested event and skip other events.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24839#discussion_r2065022560


More information about the serviceability-dev mailing list