Skip to content

Tags: winksaville/async-io

Tags

fix-missing-waker.wake.v2

Toggle fix-missing-waker.wake.v2's commit message

Verified

This commit was signed with the committer’s verified signature. The key has expired.
winksaville Wink Saville
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-missing-waker.wake.v1

Toggle fix-missing-waker.wake.v1's commit message

Verified

This commit was signed with the committer’s verified signature. The key has expired.
winksaville Wink Saville
fix: Possible fix to missing waker.wake

Add-debug-v15

Toggle Add-debug-v15's commit message

Verified

This commit was signed with the committer’s verified signature. The key has expired.
winksaville Wink Saville
debug: Add a comment regarding the bug.

Add-debug-v14

Toggle Add-debug-v14's commit message

Verified

This commit was signed with the committer’s verified signature. The key has expired.
winksaville Wink Saville
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.

Add-debug-v13

Toggle Add-debug-v13's commit message

Verified

This commit was signed with the committer’s verified signature. The key has expired.
winksaville Wink Saville
debug: Shorted long log lines

Also, added "bumped ticker" when we display the result of bumping
ticker.

Add-debug-v12

Toggle Add-debug-v12's commit message

Verified

This commit was signed with the committer’s verified signature. The key has expired.
winksaville Wink Saville
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.

Add-debug-v11

Toggle Add-debug-v11's commit message

Verified

This commit was signed with the committer’s verified signature. The key has expired.
winksaville Wink Saville
debug: Add more debug

Add-debug-v10

Toggle Add-debug-v10's commit message

Verified

This commit was signed with the committer’s verified signature. The key has expired.
winksaville Wink Saville
debug: Remove explicit use of tid() it's now in log output

Add-debug-v9

Toggle Add-debug-v9's commit message

Verified

This commit was signed with the committer’s verified signature. The key has expired.
winksaville Wink Saville
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

Add-debug-v8

Toggle Add-debug-v8's commit message

Verified

This commit was signed with the committer’s verified signature. The key has expired.
winksaville Wink Saville
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.