-
Notifications
You must be signed in to change notification settings - Fork 412
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
fix: disable background threads where we use fork #8100
fix: disable background threads where we use fork #8100
Conversation
Signed-off-by: Rudi Grinberg <me@rgrinberg.com> <!-- ps-id: 57f4c29c-44d5-4089-a81b-01ae28e5377a -->
61be40b
to
57f9a7c
Compare
@anmonteiro just to make sure, did you double check this fix worked? |
is the hang on macos CI related to the fix? |
Indeed it's likely related. If the fix is indeed what I think it is, only #8090 is a complete fix. |
Yes. |
@emillon this is good enough for 3.9.1 |
I'm a bit concerned that this still hangs on macos. Do you understand why that's the case? Do you have an idea if this makes that less likely than on 3.9.0? If we reverted the original feature, would it hang sometimes as well? |
I assume it's just because it's not safe to fork in a multi threaded application in OCaml. We still have other uses of threads, and it's not really possible to get rid of them all. |
I understand that #8090 will fix that more or less permanently, but it's probably too risky for a backport. So I'm wondering if there's a good way to mitigate what it looks to be a regression (due to the fact we're using more threads than before I suppose) |
Thinking a little more. We could mitigate the issue a little more if we:
Do you want to give these a try? |
Sure! I suppose that the first one is about doing the same as this PR, but for |
Yes, basically. |
What about the second one? I see |
Np. At the moment, the various functions in |
This is similar to ocaml#8100 for the threaded console. The reason we're doing that is to avoid threads when fork is involved. Signed-off-by: Etienne Millon <me@emillon.org>
This is similar to ocaml#8100 for the threaded console. The reason we're doing that is to avoid threads when fork is involved. Signed-off-by: Etienne Millon <me@emillon.org>
This is similar to #8100 for the threaded console. The reason we're doing that is to avoid threads when fork is involved. Signed-off-by: Etienne Millon <me@emillon.org>
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
This is similar to ocaml#8100 for the threaded console. The reason we're doing that is to avoid threads when fork is involved. Signed-off-by: Etienne Millon <me@emillon.org>
This is similar to ocaml#8100 for the threaded console. The reason we're doing that is to avoid threads when fork is involved. Signed-off-by: Etienne Millon <me@emillon.org>
CHANGES: - Disable background operations and threaded console on MacOS and other Unixes where we rely on fork. (ocaml/dune#8100, ocaml/dune#8121, fixes ocaml/dune#8083, @rgrinberg, @emillon) - Initialize async IO thread lazily. (ocaml/dune#8122, @emillon)
CHANGES: - Disable background operations and threaded console on MacOS and other Unixes where we rely on fork. (ocaml/dune#8100, ocaml/dune#8121, fixes ocaml/dune#8083, @rgrinberg, @emillon) - Initialize async IO thread lazily. (ocaml/dune#8122, @emillon)
Signed-off-by: Rudi Grinberg me@rgrinberg.com