I'm writing a test that starts a server and uses the Oneshot client to make a request. This works fine when the server runs on a single domain, but when I call Piaf.Server.Command.shutdown
with multiple domains, it fails with the error below:
[invalid] accept: file descriptor used after calling close!
Raised at Eio_unix__Fd.use_exn.(fun) in file "lib_eio/unix/fd.ml", line 20, characters 40-61
Called from Eio_posix__Err.run in file "lib_eio_posix/err.ml", line 27, characters 6-10
Called from Eio_posix__Net.Listening_socket.accept in file "lib_eio_posix/net.ml", line 32, characters 30-65
Called from Eio__Net.accept in file "lib_eio/net.ml" (inlined), line 261, characters 2-16
Called from Eio__Net.accept_fork in file "lib_eio/net.ml" (inlined), line 265, characters 19-31
Called from Piaf__Server.Command.accept_loop.(fun) in file "lib/server.ml", line 237, characters 10-661
Called from Eio__core__Fiber.any.(fun).wrap in file "lib_eio/core/fiber.ml", line 97, characters 16-20
Re-raised at Eio__core__Fiber.any in file "lib_eio/core/fiber.ml", line 138, characters 26-61
Called from Eio__core__Fiber.first in file "lib_eio/core/fiber.ml" (inlined), line 145, characters 16-26
Called from Piaf__Server.Command.accept_loop.(fun) in file "lib/server.ml", line 236, characters 8-707
Called from Piaf__Server.Command.accept_loop.(fun) in file "lib/server.ml" (inlined), line 233, characters 19-825
Called from Eio__core__Fiber.fork.(fun) in file "lib_eio/core/fiber.ml", line 20, characters 10-14
Re-raised at Eio__core__Switch.maybe_raise_exs in file "lib_eio/core/switch.ml" (inlined), line 118, characters 21-56
Called from Eio__core__Switch.run_internal in file "lib_eio/core/switch.ml" (inlined), line 139, characters 4-21
Called from Eio__core__Switch.run.(fun) in file "lib_eio/core/switch.ml" (inlined), line 153, characters 35-62
Called from Eio__core__Cancel.sub.(fun) in file "lib_eio/core/cancel.ml", line 171, characters 2-6
Called from Eio__core__Cancel.sub.(fun) in file "lib_eio/core/cancel.ml" (inlined), line 170, characters 43-58
Called from Eio__core__Cancel.with_cc in file "lib_eio/core/cancel.ml" (inlined), line 116, characters 8-12
Called from Eio__core__Cancel.sub in file "lib_eio/core/cancel.ml" (inlined), line 170, characters 2-58
Called from Eio__core__Switch.run in file "lib_eio/core/switch.ml" (inlined), line 153, characters 13-63
Called from Piaf__Server.Command.listen.(fun).run_accept_loop in file "lib/server.ml" (inlined), line 280, characters 10-431
Called from Eio__core__Cancel.sub in file "lib_eio/core/cancel.ml" (inlined), line 170, characters 2-58
Called from Eio__core__Switch.run in file "lib_eio/core/switch.ml" (inlined), line 153, characters 13-63
Called from Piaf__Server.Command.listen.(fun).run_accept_loop in file "lib/server.ml", line 280, characters 10-431
Re-raised at Eio__core__Cancel.with_cc in file "lib_eio/core/cancel.ml" (inlined), line 118, characters 32-40
Called from Eio__core__Cancel.sub in file "lib_eio/core/cancel.ml" (inlined), line 170, characters 2-58
Called from Eio__core__Switch.run in file "lib_eio/core/switch.ml" (inlined), line 153, characters 13-63
Called from Piaf__Server.Command.listen.(fun).run_accept_loop in file "lib/server.ml", line 280, characters 10-431
Called from Eio__core__Fiber.any.(fun).wrap in file "lib_eio/core/fiber.ml", line 97, characters 16-20
Re-raised at Eio__core__Fiber.any in file "lib_eio/core/fiber.ml", line 138, characters 26-61
Called from Eio__Domain_manager.run.(fun) in file "lib_eio/domain_manager.ml", line 29, characters 4-231
Re-raised at Eio__Domain_manager.run.(fun) in file "lib_eio/domain_manager.ml", line 43, characters 11-19
Called from Eio_posix__Domain_mgr.wrap_backtrace in file "lib_eio_posix/domain_mgr.ml", line 80, characters 8-12
Re-raised at Eio_posix__Domain_mgr.unwrap_backtrace in file "lib_eio_posix/domain_mgr.ml", line 88, characters 22-57
Called from Piaf__Server.Command.listen.(fun) in file "lib/server.ml" (inlined), line 277, characters 25-736
Called from Eio__core__Fiber.fork.(fun) in file "lib_eio/core/fiber.ml", line 20, characters 10-14
Re-raised at Eio__core__Switch.maybe_raise_exs in file "lib_eio/core/switch.ml", line 118, characters 21-56
Called from Eio__core__Switch.run_internal in file "lib_eio/core/switch.ml", line 139, characters 4-21
Called from Eio__core__Cancel.with_cc in file "lib_eio/core/cancel.ml", line 116, characters 8-12
Re-raised at Eio__core__Cancel.with_cc in file "lib_eio/core/cancel.ml", line 118, characters 32-40
Called from Eio_posix__Sched.with_op in file "lib_eio_posix/sched.ml", line 312, characters 8-12
Re-raised at Eio_posix__Sched.with_op in file "lib_eio_posix/sched.ml", line 318, characters 4-12
Called from Eio_posix__Sched.run.(fun) in file "lib_eio_posix/sched.ml", line 370, characters 25-43
Re-raised at Eio_posix__Sched.run.fork.(fun) in file "lib_eio_posix/sched.ml", line 333, characters 12-76
Called from Stdlib__Fun.protect in file "fun.ml", line 33, characters 8-15
Re-raised at Stdlib__Fun.protect in file "fun.ml", line 38, characters 6-52
Called from Eio_posix__Sched.run in file "lib_eio_posix/sched.ml", line 366, characters 4-217
Called from Eio_posix__Sched.with_sched in file "lib_eio_posix/sched.ml", line 252, characters 8-12
Re-raised at Eio_posix__Sched.with_sched in file "lib_eio_posix/sched.ml", line 257, characters 4-39
Called from Alcotest_engine__Core.Make.protect_test.(fun) in file "src/alcotest-engine/core.ml", line 181, characters 17-23
Called from Alcotest_engine__Monad.Identity.catch in file "src/alcotest-engine/monad.ml", line 24, characters 31-35