CHANGES:
Breaking changes:
- Before Eio 1.6, there was no
Eio_unix.Fileand so
users might have usedEio_unix.Net.import_socket_streamon e.g. files and pipes as a work-around.
That no longer works and will result in an error, e.g.
Eio.Io Unix_error (Socket operation on non-socket, "send_msg", "").
New features:
-
Add
Eio.Fiber.List.partition_map(@kentookura @avsm #927).
Concurrent version ofList.partition_map. -
Add
Eio.Switch.remove_hook ~run:true(@talex5 #972).
Removing a hook and running it at the same time simplifies some clean-up code. -
Add
Eio_unix.System_info(@talex5 @avsm #952 #969).
Provides access to OS name, version, etc. -
Add
Eio_unix.Backend_configand disable fixed buffers by default (@talex5 #960, reported by @avsm and @GongYuanCaiJi).
Fixed buffers are a minor optimisation on eio_linux, but they consume locked memory
and can trigger a bug in old versions of ZFS. You can useBackend_configto turn them
back on if desired. -
Add
Eio_unix.set_signal(@talex5 @samoht #956).
This is a work-around for ocaml/ocaml#13189,
which can cause OCaml programs to miss signals. -
Add
Path.sync_dir(@talex5 #943, requested by @samoht).
Ensures changes to directories will survive a crash.
Bugs:
-
eio_posix: don't let a trailing slash follow symlinks out of the sandbox (@avsm @talex5 #967, reported by @samoht).
-
Fix cleanup when closing Unix-domain sockets (@talex5 @avsm #971 #977, reported by @samoht).
-
Eio.Switch.run: record error before cancelling daemon fibers (@vog @talex5 #978).
When a daemon fiber was cancelled it was supposed to get aCancelled causeexception,
butcausecould beExitrather than the actual cause of the cancellation. -
Wrap
Not_foundexception fromUnix.getnameinfo(@talex5 #980, reported by @samoht, reviewed by @avsm).
Windows:
-
Support symlinks and junctions without sandbox escapes (@avsm #968).
-
nt_path: follow Win32 normalisation and add
to_win32andbeneath(@avsm #947, reviewed by @talex5).
Linux:
-
Update to new uring API to fix Unix socket problem (@talex5 #966, reported by @samoht, reviewed by @avsm).
Fixes problems with Unix-domain datagram sockets.
Generic POSIX:
-
eio_posix: use
MSG_DONTWAITfor sockets (@talex5 #951).
Always userecvmsgandsendmsgon sockets, and always set theMSG_DONTWAITflag when doing so.
This is useful for sockets shared with another process,
where the other process could change the blocking behaviour of the socket while we're using it. -
eio_posix: retry the wake-up pipe on
EINTR(@jeong-sik #957, reviewed by @talex5).
On Darwin, reading from a non-blocking pipe with data can still returnEINTR.
Build/test fixes:
-
Skip
chowntests if opam sandbox blocks them (@talex5 #955). -
Bump minimum OCaml version to 5.4 and identify thread pool (@talex5 #949).
Eio thread pools are now named, for debugging. -
Skip uring tests if uring isn't available (@talex5 #945, reviewed by @avsm).
-
Split up file and socket flows (@talex5 #950, reviewed by @avsm).
Backends now usefile_handlerorstream_handleras appropriate.
Performance:
- Use
Read_source_bufferoptimisation inFlow.Pi.simple_copy(@talex5 #954).
Before, we always allocated a buffer, read from the source into the buffer, and then wrote it to the destination.
But if the source supportsRead_source_bufferthen we can copy from the source directly, which is more efficient.
eio_posix already did this optimisation, but it makes more sense to have it in the main flow copy logic.
This also addsEio_mock.Flow.trace_readsandlimit_readsfor testing flows,
and removesEio_mock.Flow.set_copy_method.
Documentation: