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
See cleanup.ml, it calls Lwt_main.run when handling a signal.
I think this is very fragile and could lock up under some situations, reading the Lwt_main.run documentation it says:
Note that you should avoid using run inside threads
The calling threads will not resume before run returns.
Successive invocations of run are serialized: an invocation of run will not terminate before all subsequent invocations are terminated.
So if we get a signal while the main Lwt_main.run is running the one inside the signal handler wouldn't run at all.
Unfortunately the Lwt documentation is not very clear on how to resolve Lwt promises when triggered from a signal handler, but perhaps the right thing to do would be to use Lwt.async (...) (provided we have an exception handler set up for asynchronous exceptions).
The text was updated successfully, but these errors were encountered:
I'm not quite sure about the order in which things happen when we catch the signal
If the Lwt main loop is still running, then we do not need Lwt_main.run
Otherwise, if it is not running at that point, it's safe to run it.
See cleanup.ml, it calls Lwt_main.run when handling a signal.
I think this is very fragile and could lock up under some situations, reading the Lwt_main.run documentation it says:
So if we get a signal while the main Lwt_main.run is running the one inside the signal handler wouldn't run at all.
Unfortunately the Lwt documentation is not very clear on how to resolve Lwt promises when triggered from a signal handler, but perhaps the right thing to do would be to use Lwt.async (...) (provided we have an exception handler set up for asynchronous exceptions).
The text was updated successfully, but these errors were encountered: