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

submit can be run twice if another command comes in before the prior one returns. #11

Open
rcoreilly opened this issue Sep 2, 2020 · 0 comments

Comments

@rcoreilly
Copy link
Member

has been happening with grunti which fires off a status after submit -- that subsequent status ends up triggering another submit in a few cases..

given the glacial disk access on blanca, it is likely that > 10sec are passing for the first _sub to check the git repo updates, and so the second one gets the exact same set of updates.

thus, it would be good for _sub to create and remove a lock file so it is never run 2x. the problem here is cleaning up the lock after crashes, but presumably that is doable.

meanwhile, here's some lines to add to submit() method in grunter.py that should prevent the problem:

    if os.path.isfile('job.sbatch'):
        print("Error: job.sbatch exists -- attempt to submit job twice!")
        return
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

No branches or pull requests

1 participant