The sound distributed version control system

#300 if pijul crashes pijul lock is not killed

Closed on August 4, 2021
ganwell on February 6, 2021

There should be an at_exit handler that kills the pijul lock process if pijul crashes.

Currently I run this code in my pijul-git script:

def run(*args, **kwargs):
    proc = subrun(*args, **kwargs)
    path = Path(".pijul/pristine/db_lock").absolute()
    subrun(["pkill", "-f", f"pijul lock {path}"])
    return proc

If I have a similar problem in my software I do:

os.setsid()
pg = os.getpgid(os.getpid())

def cleanup():
    os.killpg(pg, signal.SIGTERM)

atexit.register(cleanup)

I know you can’t do this because of windows, but maybe it sparks and idea.

pmeunier on February 6, 2021

Thanks! This will be totally fixed after I upgrade the backend to the new Sanakirja. I leave it open in case it’s not, but the pijul lock command should disappear, I found a better cross-platform solution.

pmeunier on August 4, 2021

I believe this is completely fixed now, feel free to reopen if not. Thanks for the report!

pmeunier closed this discussion on August 4, 2021