workdir: auto-release if held by an invalid process id
The rationale is that if a working directory is being held by a process (existing or not) that is not considered part of the HGitaly system service, it means that the process was killed before it could release the working directory and the pid is either not in use or has been reused for an unrelated process. The underlying assumption is that only HGitaly is supposed to make such working directories. This could be further expanded to the roster lock. Had to put `is_current_service_process` in a separate top level module instead of, e.g., `server.mono` to avoid import loop: server.mono imports services import workdir import server.mono We need to use pytest-cov's `cleanup_on_signal` again. This time, it's easier as the subprocess startup function is defined by the test itself.
parent
57761166
No related branches found
No related tags found
Showing
- hgitaly/procutil.py 25 additions, 0 deletionshgitaly/procutil.py
- hgitaly/server/mono.py 4 additions, 0 deletionshgitaly/server/mono.py
- hgitaly/server/prefork.py 3 additions, 1 deletionhgitaly/server/prefork.py
- hgitaly/tests/test_workdir.py 103 additions, 0 deletionshgitaly/tests/test_workdir.py
- hgitaly/workdir.py 6 additions, 4 deletionshgitaly/workdir.py
Loading
Please register or sign in to comment