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

Limit to one simultaneous job per user #109

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

WeiqunZhang
Copy link
Member

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.

… 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.
@WeiqunZhang
Copy link
Member Author

E0401: Unable to import 'fasteners' (import-error)

Is there another more standard option?

status = test_suite(sys.argv[1:])
else:
print("Wait please! Another process is running regression tests.")
finally:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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

Successfully merging this pull request may close these issues.

None yet

2 participants