GeezerVison is showing github.com — Just awaking a Netty native pinned poller should return no I/O events · Issue #112 · franz1981/Netty-VirtualThread-Scheduler
Just awaking a Netty native pinned poller should return no I/O events #112
Description
We should verify this assumption and eventually modify Netty or understand how to do it right.
|
boolean hadVtWork = scheduler.maybeYield(ioEvents > 0); |
And
https://github.com/franz1981/Netty-VirtualThread-Scheduler/blob/master/core/src/main/java/io/netty/loom/EventLoopScheduler.java#L270
Stealing (because of been awaken by another asking for help!), won't happen on wakeup at that cycle, but need another non blocking I/O poll (because the previous one appear to have performed some I/O while it didn't) which would return 0 - if lucky (and no I/O really happens in the meantime).
We probably need a way on Netty side to know if the only event was a wakeup one and return 0.
The same while there's actual I/O and we don't want wakeups to be part of the other I/O events reported.
In this regard all transports behave slightly differently e.g.
┌───────────┬────────────────────────────────┬──────────┐
│ Transport │ Wakeup-only returns │ Correct? │
├───────────┼────────────────────────────────┼──────────┤
│ NIO │ 0 │ Yes │
├───────────┼────────────────────────────────┼──────────┤
│ Epoll │ 1 (eventfd counted) │ No │
├───────────┼────────────────────────────────┼──────────┤
│ io_uring │ 1-2 (eventfd + timeout cancel) │ No │
└───────────┴────────────────────────────────┴──────────┘
Activity
changed the title
[-]Workstealing relies on the assumption that awaking a pinned poller w Netty return I/O events[/-] [+]Workstealing reliJust awaking a Netty native pinned poller should return no I/O events[/+] on May 24, 2026changed the title
[-]Workstealing reliJust awaking a Netty native pinned poller should return no I/O events[/-] [+]Just awaking a Netty native pinned poller should return no I/O events[/+] on May 24, 2026franz1981 commented on May 25, 2026
Thinking about this twice, let's say netty/netty#16848 is fixing this for BOTH timers AND wakeup(s): if the event loop return 0 in both cases, it will still trigger an attempt to perform work stealing, which hasn't been actively requested by any "overwhelmed" carrier.
This is not great TBH, but is "kind of fine" the same, as we try correctly try to steal in 2 cases:
- if we have NOTHING to do before blocking on I/O
- if we have NOTHING to do on checkpoints (both using the same maybeYield)
And effectively, a timer expiration (because of deadline reached) is still a checkpoint that:
- the carrier is alive
- if there's NOTHING to do (timer expiration apart), why not helping others?
franz1981 commented on Jun 17, 2026
Metadata
Metadata
Development
No branches or pull requestsIssue actions