-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lwt.pick doesn't cancel #166
Comments
Note that the The |
Suggested solution: return a |
The success case ran and then after exiting the pick the FD was closed. The test case comes from a larger program which launches multiple Given this kind of scenario, the current semantics of "maybe your other threads will eventually be canceled by |
Your success case didn't run after the |
Ah, I understand what you mean now. If I simply factor |
Build with :
ocamlfind ocamlopt -package lwt.unix -linkpkg -g lwt_pick_bug.ml -o lwt_pick_bug
Run with:
./lwt_pick_bug
and./lwt_pick_bug cancel
I expected the threads not selected by
pick
to be canceled. I observed that they were not canceled.apnea
is the reproduction case andinception
is the fixed case. I'm not terribly happy with| Canceled -> return ()
but I can live with it if necessary. Is there a better way to timeout syscalls? Have a made some mistake in my application of Lwt calls? I found thispick
behavior very surprising and contrary to the documentation.The text was updated successfully, but these errors were encountered: