On Fri, 26 Jun 2026 14:39:54 GMT, Daniel Fuchs <[email protected]> wrote:

>> src/java.net.http/share/classes/jdk/internal/net/http/quic/QuicTimerQueue.java
>>  line 359:
>> 
>>> 357:                 // On the other hand, if deadline < notifiedDeadline, 
>>> we
>>> 358:                 // need to call the notifier to force an additional 
>>> wakeup
>>> 359:                 if (deadline.isBefore(notifiedDeadline)) {
>> 
>> `notifiedDeadline` is basically the same as `scheduledDeadline`. Please 
>> remove the `scheduled` method and use `scheduledDeadline` here.
>
> It's unfortunately not. `notifiedDeadline` is about when to call the 
> `notifier.run()` again. It is the minimum deadline that caused notifier.run() 
> to be called. Any deadline later or equal to this should not cause the 
> notifier to be run again. This does not exactly match with the 
> `scheduledDeadline` which is a prospective deadline that was submitted to 
> `rescheduled` while the selector may not yet have folded it into `scheduled`. 
> You will notice that `scheduledDeadline` is set again to `Deadline.MAX` as 
> soon as the `next` deadline has been computed. `notifiedDeadline` is not. In 
> other words `notifiedDeadline` is there to figure out whether  the selector 
> should be woken up early again right after 
> `processEventsAndReturnNextDeadline` finishes in order to process events 
> again and recompute a new deadline. `scheduledDeadline` is the prospective 
> deadline that will be returned by `processEventsAndReturnNextDeadline`. I 
> have tried very hard to not add a third deadline, but ended up doing it 
> anyway given that they have a different life cycle.

Ok, let's revisit that in a separate issue.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/31693#discussion_r3482776690

Reply via email to