We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2d51386 commit 057c8a5Copy full SHA for 057c8a5
aiida/cmdline/utils/daemon.py
@@ -126,8 +126,13 @@ class StartCircusNotFound(Exception):
126
if pid is not None:
127
try:
128
process = psutil.Process(pid)
129
+ # the PID got recycled, but a different process
130
if _START_CIRCUS_COMMAND not in process.cmdline():
131
raise StartCircusNotFound() # Also this is a case in which the process is not there anymore
132
+
133
+ # the PID got recycled, but for a daemon of someone else
134
+ if process.username() != psutil.Process().username(): # compare against the username of this interpreter
135
+ raise StartCircusNotFound()
136
except (psutil.AccessDenied, psutil.NoSuchProcess, StartCircusNotFound):
137
echo.echo_warning(
138
f'Deleted apparently stale daemon PID file as its associated process<{pid}> does not exist anymore'
0 commit comments