Tags: winksaville/async-io
Tags
fix: missing waker.wake My analysis of the problem is that using the current `Reactor::ticker` value in `ticks` is not always correct. It is my understanding that when placing a ticker value into `Direction::ticks` there is a guarantee that the waker.wake call has completed and the associated task has been run. The problem is the increment of the ticker value is in `ReactorLock::react` is typically running on a different CPU thread than the `Source::poll_ready` (called by `poll_readable`, `poll_writeable`), which is saving the ticker value in ticks: state[dir].ticks = Some((Reactor::get().ticker(), state[dir].tick)); Because the increment and use of ticker value are on different threads the required guarantee can not be full filled and I'm proposing the following fix in this PR, which only uses the a current `state[dir].tick` and not the ticker value: state[dir].ticks = Some((state[dir].tick, 0) fix smol-rs#78
fix: Change setting of ticks Try NOT using the current Reactor.ticker, just use the current tick. The reason is we don't know if the current Reactor.ticker actually has been used and in this bug that is definitely the case. The other option is to use None, but this is "true" so seems reasonable.
debug: Shorted long log lines Also, added "bumped ticker" when we display the result of bumping ticker.
debug: Add raw fd to many log statements Learn the association between ticker, tick, ticks and fd. And is seems an fd is a reasonable identifier of a event source and destination.
debug: Remove explicit use of tid() it's now in log output
debug: Remove the Backtrace::force_capture calls This didn't work, Wakers don't do any specific work associated with the task and is simply invoked via a vtable and has one opaque "data" parameter. See https://doc.rust-lang.org/std/task/struct.Waker.html and code here https://doc.rust-lang.org/src/core/task/wake.rs.html
debug: Add Backtrace::force_capture to poll and poll_ready I want to see how waker.wake works so I need to know where they come from and how it maybe related to the missing Incoming connection.
PreviousNext