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

Deal with unreachable daemon worker in get_daemon_status #3683

Merged
merged 1 commit into from
Dec 17, 2019

Conversation

sphuber
Copy link
Contributor

@sphuber sphuber commented Dec 17, 2019

Fixes #2485

The aiida.cmdline.utils.daemon.get_daemon_status utility function used
in verdi daemon status calls the DaemonClient.get_worker_info method
which will ask the circus client to get information of the daemon
workers it is managing. Under normal conditions this will return a
dictionary of worker pids with a dictionary of their stats. However,
sometimes the daemon may fail to retrieve these stats and the dictionary
is replaced with a string containing an error message. The
get_daemon_status method now deals with this elegantly and temporary
prints - as placeholder for the unknown statistics. Since this is
typically caused by a transient problem the next time the command is
called the correct information will be displayed.

Copy link
Member

@ltalirz ltalirz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @sphuber for the fix, looks good to me!
Let's perhaps wait for @ConradJohnston to see whether he thinks so as well.

Copy link
Contributor

@ConradJohnston ConradJohnston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this in the wild on my poorly installation - looks good, thank you.

@sphuber
Copy link
Contributor Author

sphuber commented Dec 17, 2019

Tests are failing just due to stupid timezone differences and literal string comparisons

The `aiida.cmdline.utils.daemon.get_daemon_status` utility function used
in `verdi daemon status` calls the `DaemonClient.get_worker_info` method
which will ask the circus client to get information of the daemon
workers it is managing. Under normal conditions this will return a
dictionary of worker pids with a dictionary of their stats. However,
sometimes the daemon may fail to retrieve these stats and the dictionary
is replaced with a string containing an error message. The
`get_daemon_status` method now deals with this elegantly and temporary
prints `-` as placeholder for the unknown statistics. Since this is
typically caused by a transient problem the next time the command is
called the correct information will be displayed.
@sphuber sphuber merged commit e95d57b into aiidateam:develop Dec 17, 2019
@sphuber sphuber deleted the fix_2485_verdi_daemon_status branch December 17, 2019 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

verdi daemon status command fails
3 participants