I have run into an error that I am not sure how to debug. The error is Exception: (Unix.Unix_error "Too many open files" pipe "")
. I am not opening any files and only have a single Unix process open. Anybody have some tips on how to debug this?
The function causing the error is:
let rec update_act_odrs ?(sec_to_wait = 0.0) () =
try
(act_odrs := active_orders ())
|> fun _ -> Lwt_io.print "active_orders Updated\n"
with _ ->
Lwt_unix.sleep sec_to_wait
>>= update_act_odrs ~sec_to_wait:(sec_to_wait +. 1.0)
where active_orders ()
is a function that gets JSON data from a server.