You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
select await deadlocks when a losing branch is blocked in recv(): the ready branch is never taken #1293
Found rewriting `examples/nebula` under #1150 ruling 4 (its "race data-ready against shutdown" `select await` demo).
```
use std.channel
async fn never -> i32:
let (tx, rx) = chani32
rx.recv().unwrap() // nobody sends: blocks forever
async fn now -> i32: 1
async fn main:
let a = never()
let b = now()
select await:
_ = a => print("never")
_ = b => print("now")
print("after select")
```
Expected (§14.10): `now` wins, the loser is cancelled at its next suspension point, the program prints `now` / `after select` and exits. Actual: nothing is printed and the process never exits (`timeout 10` kills it, rc 124). When both branches are ready (`sel4`: a value sent on both channels first) the select completes normally, so the defect is the runtime's handling of a fiber parked in `recv()` while another branch of the same select is complete — the scheduler does not return to the selecting fiber.
Installed `with v0.15.2.1-g478b26481`. The nebula demo is written with a sleeping loser instead (`sleep(Duration.millis(300)).await`, which needs #1284 for `Duration`) and documents the constraint.
Activity
examples: rewritten to the current spec (D55 ruling 4) + examples-tes…
rt/MIR: cancellation cuts a parked channel wait short and the fiber u…
rt/MIR: select await no longer hangs on a loser parked in recv() — ca…