MyLifeLabs / nproc

Process pools for OCaml
Other
29 stars 6 forks source link

Error while handling result of Nproc task #7

Open leostera opened 5 years ago

leostera commented 5 years ago

Hello!

Found out with @anmonteiro that after creating a pool of X threads, nproc seems to be writing out X-1 error messages:

[err] Error while handling result of Nproc task: exception Invalid_argument("Lwt.wakeup")

Minimum code to be reproduced can be found here: https://github.com/rizo/nproc/blob/master/example.ml

The work seems to be done in parallel either way, which is good, but it'd be great to get rid of this error message.

alexandreDebant commented 5 years ago

Hello!

I was able to reproduce the error with a way smaller example :

open Lwt

let ppool, plwt = Nproc.create 2

let () = 
    let _ = Lwt_main.run @@ Nproc.submit ppool (fun x -> ()) () in 
    let _ = Lwt_main.run @@ Nproc.submit ppool (fun x -> ()) () in ()

Has a workaround or a proper fix been found ?

Best,

A.