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

Races between sub-dune processes #3566

Open
emillon opened this issue Feb 25, 2022 · 1 comment
Open

Races between sub-dune processes #3566

emillon opened this issue Feb 25, 2022 · 1 comment

Comments

@emillon
Copy link
Contributor

emillon commented Feb 25, 2022

Hi!

@Leonidas-from-XIV and I noticed some race conditions in the commandline parsing chapter when using dune 3.0.2.
The symptoms are "text file busy" errors and "rule did not produce .ppx/hash/ppx.exe".

The root cause is that several sub-dune processes (invoked by test targets by the "main" dune process) are invoked concurrently in the same directory. That's not supported by dune. This happens in particular between the mdx rule that checks the chapter and the dune build @all @runtest commands that check each example directory.

The correct fix for that is to use dune locks for these actions, but unfortunately the (mdx) stanza does not support this (and RWO would need to be upgrading to stanza 0.2). Adding a single lock shared by all examples seems to make the race conditions go away though, and might be a solution that's good enough in the meantime (note that the rules are still racy with dune 2.9 but for some reason we haven't seen any races with dune 2.9).

@emillon
Copy link
Contributor Author

emillon commented May 13, 2022

This has been merged on the dune side and I have checked that this seems to prevent such races. RWO needs to be updated to (lang dune 3.2), (using mdx 0.3) (fairly mechanical) and the example generator needs to add the proper (locks).

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

No branches or pull requests

1 participant