Skip to content

Some fixes for cancellation#254

Merged
talex5 merged 1 commit intoocaml-multicore:mainfrom
talex5:fix-cancel
Jul 18, 2022
Merged

Some fixes for cancellation#254
talex5 merged 1 commit intoocaml-multicore:mainfrom
talex5:fix-cancel

Conversation

@talex5
Copy link
Copy Markdown
Collaborator

@talex5 talex5 commented Jul 18, 2022

  • Run cancel functions in the order in which the fibers were added, for simplicity.

  • Cancel.cancel collects the cancel functions for all the fibers at once, and then calls them in series. This means that a job may have completed and been freed by the time its cancel function is called. Just ignore the cancellation in that case.

  • If an eio_linux job succeeds, report the success even if it was also cancelled. This allows e.g. closing an allocated FD.

@talex5 talex5 force-pushed the fix-cancel branch 2 times, most recently from 0296990 to 582207f Compare July 18, 2022 10:07
- Run cancel functions in the order in which the fibers were added, for
  simplicity.

- `Cancel.cancel` collects the cancel functions for all the fibers at
  once, and then calls them in series. This means that a job may have
  completed and been freed by the time its cancel function is called.
  Just ignore the cancellation in that case.

- If an eio_linux job succeeds, report the success even if it was also
  cancelled. This allows e.g. closing an allocated FD.
@talex5 talex5 merged commit b46ffba into ocaml-multicore:main Jul 18, 2022
@talex5 talex5 deleted the fix-cancel branch July 18, 2022 10:15
talex5 added a commit to talex5/opam-repository that referenced this pull request Aug 4, 2022
CHANGES:

Note: Eio 0.4 drops compatibility with OCaml 4.12+domains. Use OCaml 5.0.0~alpha1 instead.

API changes:

- `Eio.Dir` has gone. Use `Eio.Path` instead (@talex5 ocaml-multicore/eio#266 ocaml-multicore/eio#270).

- `Eio_unix.FD.{take,peek}` were renamed to `take_opt`/`peek_opt` to make way for non-optional versions.

New features:

- Fiber-local storage (@SquidDev ocaml-multicore/eio#256).
  Attach key/value bindings to fibers. These are inherited across forks.

- `Eio.Path.{unlink,rmdir,rename}` (@talex5 ocaml-multicore/eio#264 ocaml-multicore/eio#265).

- `Eio_main.run` can now return a value (@talex5 ocaml-multicore/eio#263).
  This is useful for e.g. cmdliner.

- `Eio_unix.socketpair` (@talex5 ocaml-multicore/eio#260).

- `Fiber.fork_daemon` (@talex5 ocaml-multicore/eio#252).
  Create a helper fiber that does not prevent the switch from exiting.

- Add `Fiber.{iter,map,filter,fiter_map}` (@talex5 ocaml-multicore/eio#248 ocaml-multicore/eio#250).
  These are concurrent versions of the corresponding operations in `List`.

Bug fixes:

- Fix scheduling fairness in luv backend (@talex5 ocaml-multicore/eio#269).

- Implement remaining shutdown commands for luv (@talex5 ocaml-multicore/eio#268).

- Fix IPv6 support with uring backend (@haesbaert ocaml-multicore/eio#261 ocaml-multicore/eio#262).

- Use `Eio.Net.Connection_reset` exception in more places (@talex5 ocaml-multicore/eio#257).

- Report use of closed FDs better (@talex5 ocaml-multicore/eio#255).
  Using a closed FD could previously cause the whole event loop to exit.

- Some fixes for cancellation (@talex5 ocaml-multicore/eio#254).

- Ensure `Buf_write` still flushes if an exception is raised (@talex5 ocaml-multicore/eio#246).

- Do not allow close on `accept_fork` socket (@talex5 ocaml-multicore/eio#245).

Documentation:

- Document integrations with Unix, Lwt and Async (@talex5 ocaml-multicore/eio#247).

- Add a Dockerfile for easy testing (@talex5 ocaml-multicore/eio#224).
talex5 added a commit to talex5/opam-repository that referenced this pull request Aug 4, 2022
CHANGES:

Note: Eio 0.4 drops compatibility with OCaml 4.12+domains. Use OCaml 5.0.0~alpha1 instead.

API changes:

- `Eio.Dir` has gone. Use `Eio.Path` instead (@talex5 ocaml-multicore/eio#266 ocaml-multicore/eio#270).

- `Eio_unix.FD.{take,peek}` were renamed to `take_opt`/`peek_opt` to make way for non-optional versions.

New features:

- Fiber-local storage (@SquidDev ocaml-multicore/eio#256).
  Attach key/value bindings to fibers. These are inherited across forks.

- `Eio.Path.{unlink,rmdir,rename}` (@talex5 ocaml-multicore/eio#264 ocaml-multicore/eio#265).

- `Eio_main.run` can now return a value (@talex5 ocaml-multicore/eio#263).
  This is useful for e.g. cmdliner.

- `Eio_unix.socketpair` (@talex5 ocaml-multicore/eio#260).

- `Fiber.fork_daemon` (@talex5 ocaml-multicore/eio#252).
  Create a helper fiber that does not prevent the switch from exiting.

- Add `Fiber.{iter,map,filter,fiter_map}` (@talex5 ocaml-multicore/eio#248 ocaml-multicore/eio#250).
  These are concurrent versions of the corresponding operations in `List`.

Bug fixes:

- Fix scheduling fairness in luv backend (@talex5 ocaml-multicore/eio#269).

- Implement remaining shutdown commands for luv (@talex5 ocaml-multicore/eio#268).

- Fix IPv6 support with uring backend (@haesbaert ocaml-multicore/eio#261 ocaml-multicore/eio#262).

- Use `Eio.Net.Connection_reset` exception in more places (@talex5 ocaml-multicore/eio#257).

- Report use of closed FDs better (@talex5 ocaml-multicore/eio#255).
  Using a closed FD could previously cause the whole event loop to exit.

- Some fixes for cancellation (@talex5 ocaml-multicore/eio#254).

- Ensure `Buf_write` still flushes if an exception is raised (@talex5 ocaml-multicore/eio#246).

- Do not allow close on `accept_fork` socket (@talex5 ocaml-multicore/eio#245).

Documentation:

- Document integrations with Unix, Lwt and Async (@talex5 ocaml-multicore/eio#247).

- Add a Dockerfile for easy testing (@talex5 ocaml-multicore/eio#224).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant