Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signal handlers may not run, especially with eio_linux #732

Open
talex5 opened this issue May 22, 2024 · 0 comments
Open

Signal handlers may not run, especially with eio_linux #732

talex5 opened this issue May 22, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@talex5
Copy link
Collaborator

talex5 commented May 22, 2024

Since #728, we submit requests and wait for replies in a single system call. If a signal is received while waiting in io_uring_enter but after some requests were accepted, it returns the number of requests submitted rather than EINTR. This causes liburing to retry without returning to OCaml, which means that the OCaml part of the signal handler doesn't run.

This particular problem could be fixed by modifying liburing. However, there is another race affecting system calls more generally (ocaml/ocaml#13189) and fixing that would also fix this as a side-effect.

This bug can cause Lwt_eio's tests to hang, as Lwt doesn't get the SIGCHLD signal it is expecting (Eio doesn't suffer from this problem itself because it uses process FDs to wait for child processes instead). We've also had similar problems with other libraries in the past (e.g. #400).

@talex5 talex5 added the bug Something isn't working label May 22, 2024
talex5 added a commit to talex5/eio that referenced this issue May 23, 2024
webbunivAdmin pushed a commit to webbunivAdmin/eio that referenced this issue Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant