Skip to content

Signals don't get processed while Fibers are scheduled? #301

@anmonteiro

Description

@anmonteiro

I couldn't get eio to handle my signals while another fiber is running (even if sleeping). Take this pathological case:

open Eio.Std

let () =
  Sys.(
    set_signal
      sigint
      (Signal_handle
         (fun i ->
           Format.eprintf "handle signal: %d@." i;
           exit 0)));
  Eio_main.run (fun _env ->
      Switch.run (fun sw ->
          Fiber.fork ~sw (fun () -> Eio.Time.sleep (Eio.Stdenv.clock _env) 5.)))

You can send ctrl+C to the program while it's running and it won't process it until after 5 seconds (when the eio fiber ends).

Tested on macOS (with eio_luv)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions