Skip to content

Check if pidlock process is still running #50213

@maleadt

Description

@maleadt

I somehow interrupted a precompilation process, resulting in a stale pidlock somewhere in my depot. This causes precompilation to hang, which for all intents and purposes looks like a plain hang (IIUC JuliaLang/Pkg.jl#3519 wouldn't help here, because this is triggered by using Package in code, not by Pkg.precompile()).

Setting JULIA_DEBUG shows that its stuck waiting for a pidlock, as does the backtrace when interrupting:

┌ Debug: Waiting for another process (pid: 5719) to finish precompiling CUDA [052768ef-5323-5732-b1bb-66c8b64840ba]
└ @ Base loading.jl:2831
^C
[7169] signal (2): Interrupt
in expression starting at /home/tim/Julia/pkg/CUDA/wip.jl:1
epoll_wait at /usr/lib/libc.so.6 (unknown line)
uv__io_poll at /workspace/srcdir/libuv/src/unix/epoll.c:236
uv_run at /workspace/srcdir/libuv/src/unix/core.c:400
ijl_task_get_next at /home/tim/Julia/src/julia/src/partr.c:436
unknown function (ip: 0x7f59f774c93e)
unknown function (ip: 0x7f59f75d646c)
unknown function (ip: 0x7f59f77a27c5)
unknown function (ip: 0x7f59f704af20)
unknown function (ip: 0x7f59f6fa0c03)
watch_file at /home/tim/Julia/src/julia/build/dev/usr/share/julia/stdlib/v1.10/FileWatching/src/FileWatching.jl:778 [inlined]
JuliaLang/Pkg.jl#13 at /home/tim/Julia/src/julia/build/dev/usr/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:257
unknown function (ip: 0x7f5a0d07daf9)
_jl_invoke at /home/tim/Julia/src/julia/src/gf.c:2870 [inlined]
ijl_apply_generic at /home/tim/Julia/src/julia/src/gf.c:3071
jl_apply at /home/tim/Julia/src/julia/src/julia.h:1963 [inlined]
start_task at /home/tim/Julia/src/julia/src/task.c:1238
unknown function (ip: (nil))
Allocations: 2836 (Pool: 2827; Big: 9); GC: 0

Crucially, process 5719 just doesn't exist anymore. Instead of waiting for the pidlock to go stale, which seems like ages (it's been almost 10 minutes), shouldn't we first check if the process even exists and if not break the lock?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions