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

CLI: interface for manully clean stale PID file #6007

Merged
merged 4 commits into from
May 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions aiida/engine/daemon/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,8 @@ def call_client(self, command: dict[str, t.Any], timeout: int | None = None) ->

if self._is_pid_file_stale:
raise DaemonStalePidException(
'The daemon could not be reached, seemingly because of a stale PID file. Try starting the daemon '
'to remove it and restore the daemon.'
'The daemon could not be reached, seemingly because of a stale PID file. Either stop or start the '
'daemon to remove it and restore the daemon to a functional state.'
) from exception

if str(exception) == 'Timed out.':
Expand Down Expand Up @@ -557,6 +557,8 @@ def stop_daemon(self, wait: bool = True, timeout: int | None = None) -> dict[str
:raises DaemonTimeoutException: If the connection to the daemon timed out.
:raises DaemonException: If the connection to the daemon failed for any other reason.
"""
self._clean_potentially_stale_pid_file()

command = {'command': 'quit', 'properties': {'waiting': wait}}
response = self.call_client(command, timeout=timeout)

Expand Down