-
Notifications
You must be signed in to change notification settings - Fork 10.5k
ModuleInterface: lock .swiftinterface while generating module cache #29101
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
Conversation
@swift-ci please smoke test |
This ensures only one process is generating module cache from an interface file so that we don't blow up memory usage when multiple processes are doing the same. The locking mechanism is similar to that of Clang's. A better approach is that the build system takes care of the module building step as a formal dependency. rdar://52839445
53df79e
to
8dda019
Compare
@swift-ci please smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
The issue I saw when I was testing this same thing was that |
hmm, if one iteration isn't sufficient then the process should enter another cycle of waiting the lock. Does 40 sec limit really matter in this case? |
Wouldn’t that start a new build? |
That would start acquiring another lock (notice there is a while(1) loop outside of the lock). But your point makes me think probably we should keep waiting if timed-out rather than removing the lock file unconditionally, which means opening the flood gate and suddenly all processes start to rebuilding. |
Seeing test failure which might be related to this PR:
|
This ensures only one process is generating module cache from an interface
file so that we don't blow up memory usage when multiple processes are
doing the same. The locking mechanism is similar to that of Clang's.
A better approach is that the build system takes care of the module building
step as a formal dependency.
rdar://52839445