aiidateam / aiida-core

The official repository for the AiiDA code
https://aiida-core.readthedocs.io
Other
435 stars 188 forks source link

'verdi process list' "fails" when a stale daemon PID file is present #3866

Closed greschd closed 11 months ago

greschd commented 4 years ago

The verdi process list command has a non-zero exit code when the daemon PID file is stale, because it can not find the number of active workers:

$ verdi process list
PK    Created    Process label    Process State    Process status
----  ---------  ---------------  ---------------  ----------------

Total results: 0

Info: last time an entry changed state: 12D ago (at 10:55:57 on 2020-03-13)
Critical: Could not contact Circus to get the number of active workers

Running verdi daemon status fixes it:

$ verdi daemon status
Warning: Deleted apparently stale daemon PID file as its associated process<799> does not exist anymore
Profile: default
The daemon is not running
$ verdi process list
PK    Created    Process label    Process State    Process status
----  ---------  ---------------  ---------------  ----------------

Total results: 0

Info: last time an entry changed state: 12D ago (at 10:55:57 on 2020-03-13)
Warning: the daemon is not running

This is a pretty minor thing, but maybe we could add the check for stale PID also in the verdi process list code?

For some context: The reason I ran into this is because some of my (old, aiida-pytest) tests run verdi process list -a for debugging purposes, which ended up failing.

ramirezfranciscof commented 4 years ago

Hi @greschd , would you happen to know if this could have the same underlying problem as with #3800 or are these completely unrelated?

greschd commented 4 years ago

At a quick glance it seems unrelated - I am having stale daemon PID files when running on WSL, which doesn't have a proper init system (so there is actually no daemon running).

I think the logic to check for stale files just isn't present in verdi process list.

ltalirz commented 1 year ago

Confirming this still exists in aiida-core 2.1.2

sphuber commented 11 months ago

This should have been fixed in at least v2.4, possibly earlier