mirror of
https://github.com/c-cube/moonpool.git
synced 2025-12-06 03:05:30 -05:00
fix: in Fut.await, upon failure, use resume
otherwise a fairly vicious bug happens: the await-er is resumed on the current runner, not its native one, which can cause deadlocks as it breaks the executors' dependency DAG. When using `resume` there is no bug since `resume` is designed to always schedule on the correct runner.
This commit is contained in:
parent
0d325741f4
commit
ac851a6d81
1 changed files with 1 additions and 1 deletions
|
|
@ -438,7 +438,7 @@ let await (fut : 'a t) : 'a =
|
|||
resume k (Ok ())
|
||||
| Error (exn, bt) ->
|
||||
(* fail continuation immediately *)
|
||||
k (Error (exn, bt))));
|
||||
resume k (Error (exn, bt))));
|
||||
};
|
||||
(* un-suspended: we should have a result! *)
|
||||
get_or_fail_exn fut
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue