ocaml-multicore / eio

Effects-based direct-style IO for multicore OCaml
Other
529 stars 67 forks source link

eio_linux: retry openat2 on EAGAIN #693

Closed talex5 closed 5 months ago

talex5 commented 5 months ago

CI fails sometimes with this error:

--- a/_build/default/tests/fs.md
+++ b/_build/default/tests/.mdx/fs.md.corrected
@@ -550,7 +550,7 @@ Create a sandbox, write a file with it, then read it from outside:
 +Eio.Io Fs Permission_denied _, opening directory <cwd:/>
 +open_dir <cwd:foo/bar/..> -> OK
 +open_dir <fs:foo/bar> -> OK
-+open_dir <cwd:foo/up/foo/bar> -> OK
++Eio.Io Unix_error (Resource temporarily unavailable, "openat2", ""), opening directory <cwd:foo/up/foo/bar>
 +Eio.Io Fs Permission_denied _, opening directory <cwd:foo/root/..>
 - : unit = ()

The man-page says:

the kernel could not ensure that a ".." component didn't escape (due to a race condition or potential attack). The caller may choose to retry the openat2() call.