-
Notifications
You must be signed in to change notification settings - Fork 107
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
There is a problem with the lock file lock in runner. #270
Comments
File lock before refactoring: https://github.com/KusionStack/KCLVM/compare/main...Peefy:refine-llvm-assembler?expand=1 |
After PR #71 and #215, this bug appeared, there is a problem with file locking during concurrent compilation. Before PR #71 and #215, the main package and non-main package will lock the different files, compiling main package will lock a temp file whose filename based on time and process id and compiling other package will lock the file whose filename is '<package_name>.ll.lock'. The file lock used in concurrent compilation will lock the file:
|
After PR #71 and #215, both compiling main package and non-main package will lock a temp file whose filename based on time and process id. For the non-main package, when multiple threads access the same file, they will acquire different file locks, which will cause the lock to fail. Multiple threads should acquire the same file lock when accessing the same file. The file lock used in concurrent compilation will lock the file:
The method |
What is the solution to the problem? |
PR #272 fixed the bug, and created different file locks according to the current package type before concurrent compilation. code from feca470:
|
I will add some more test cases for concurrent compilation to expose the problems as much as possible. |
#272) * Fix(kclvm-runner): Added different file locks depending on the currently package. If the current package is the main package, the lock will lock a temporary file based on time and process id. If the current package is not the main package, the lock will lock a file named 'package_path.ll.lock'. issue #270. * rm useless comments * add a large scale test case * add konfig test * add some comments
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
File lock only locks 'main'.
2. What did you expect to see? (Required)
File locks should lock all 'pkgpath'
3. What did you see instead (Required)
4. What is your KusionStack components version? (Required)
The text was updated successfully, but these errors were encountered: