janestreet / async_unix

Jane Street Capital's asynchronous execution library (unix)
MIT License
33 stars 21 forks source link

Exceed the maximum number of file descriptor #10

Closed bobot closed 11 months ago

bobot commented 8 years ago

There must be a bug in my program (filedescriptor leaking), however the error I obtained in this case seems quite uninformative. Perhaps the problem should be caught before, with a gentler error message.

((exn
  ("key's index out of range" (8192 8192 (Should_be_between_0_and 8191))
   /home/oci/.opam/4.02.3/build/core_kernel.113.33.01/_build/src/bounded_int_table.ml:176:4))
 (backtrace
  ("Raised at file \"src/error.ml\", line 7, characters 20-30"
   "Called from file \"src/bounded_int_table.ml\", line 225, characters 8-23"
   "Called from file \"src/fd_by_descr.ml\", line 34, characters 8-47"
   "Called from file \"src/raw_scheduler.ml\", line 146, characters 2-38"
   "Called from file \"src/deferred1.ml\", line 14, characters 63-68"
   "Called from file \"src/job_queue.ml\", line 160, characters 6-47" ""))
ghost commented 8 years ago

Indeed, note that you can change this limit with ASYNC_CONFIG=((max_num_open_file_descrs 10000))

bobot commented 8 years ago

Feature-wish: perhaps even, you could, if possible, save in a file the result of ls -l /proc/self/fd