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

main: used lockedSection instead of explicit lock/unlock calls #177

Merged
merged 2 commits into from May 12, 2022

Conversation

wwade
Copy link
Owner

@wwade wwade commented May 12, 2022

It's better to use a context manager for locks so that unlock calls are not missed.
Basically we just put a locked section around the implementation of "main", but back
out of it temporarily when we (maybe) fork the child process that runs the job. The
parent then exits (lock not held), while the child process will regain the lock while
it handles the rest of the options, finally releasing it before calling runJob.

In runJob, again, when it terminates, it updates the database and so uses another
lockedSection() call.

wwade added 2 commits May 12, 2022 14:58
Changed setup.cfg to require python >= 3.7 and updated the build-system spec in
pyproject.toml.
It's better to use a context manager for locks so that unlock calls are not missed.
Basically we just put a locked section around the implementation of "main", but back
out of it temporarily when we (maybe) fork the child process that runs the job. The
parent then exits (lock not held), while the child process will regain the lock while
it handles the rest of the options, finally releasing it before calling runJob.

In runJob, again, when it terminates, it updates the database and so uses another
lockedSection() call.
@wwade wwade enabled auto-merge (rebase) May 12, 2022 23:32
@wwade wwade merged commit c7ec87f into master May 12, 2022
@wwade wwade deleted the lock-fix branch May 12, 2022 23:35
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

1 participant