Limit to one simultaneous job per user#109
Limit to one simultaneous job per user#109WeiqunZhang wants to merge 2 commits intoAMReX-Codes:mainfrom
Conversation
… by the same user running at the same time. We use a shared account for regression testing. Without the lock, we often step on each other's toes.
|
Is there another more standard option? |
8382129 to
c5c3880
Compare
| status = test_suite(sys.argv[1:]) | ||
| else: | ||
| print("Wait please! Another process is running regression tests.") | ||
| finally: |
There was a problem hiding this comment.
What would happen if we never reach finally, e.g., if the try: block calls sys.exit or if some other reason aborts mission. Should we somehow clean up the file lock on fresh runs?
I am also a bit confused with the tempdir above: would multiple users not receive different temp dirs and thus never see the same locks?
There was a problem hiding this comment.
If a process dies without calling release, a fresh run will still be able to acquire the lock, because the lock is on the number of file handles not on the existence of the file.
This is meant to limit multiple runs by the same user, not among different users. At CCSE, we use a shared account on our regression testing machine. Multiple people use that account to run jobs manually. People often started a run without realizing another person had already started a run. The second run would kill the first one making the first person wonder what had just happened.
Using a lock file to protect against multiple regression testing jobs by the
same user running at the same time. We use a shared account for regression
testing. Without the lock, we often step on each other's toes.