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
Race condition in "make regen-all" when running jobs in parallel #86564
Comments
When building the Fedora package of Python 3.10, *sometimes* the "make regen-all" fail to build with errors like: Example: https://src.fedoraproject.org/rpms/python3.9/pull-request/40 The _WEAKREF_GETWEAKREFCOUNT_METHODDEF macro is defined by Modules/clinic/_weakref.c.h which is included by Modules/_weakref.c (at line 13). It seems like while Modules/_weakref.o was being built, Modules/clinic/_weakref.c.h was being generated "at the same time". The "make regen-all" command runs "make clinic" and "make regen-importlib" targets:
On Fedora, packages are built using MAKEFLAGS="-j<N>" where <N> is a number, like "-j4". Since there is no dependency between "clinic" and "regen-importlib" targets, these two targets *can* be run in parallel. It seems like "make clinic" always rewrites *all* generated files and the half of writes are *not* atomic. Attached PR makes all writes of clinic.py atomic *and* also avoids modifying the file modification file if the content does not change, as done in other "make regen-all" targets (using Tools/scripts/update_file.py). |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: