aiida-core
aiida-core copied to clipboard
CLI: `verdi daemon restart` `--timeout` option not working as expected
Describe the bug
I'm running into the following:
❯ verdi daemon restart --reset --timeout 20
Profile: dev
Stopping the daemon... OK
Starting the daemon with 1 workers... FAILED
Critical: The daemon failed to start or is unresponsive after 2 seconds.
The message is pretty clear that it's also possible that the daemon started but is simply unresponsive, but I would expect that it waits for 20 seconds due to the --timeout
setting
-t, --timeout INTEGER Time in seconds to wait for a response
before timing out.
I then configured the default timeout
to 20 seconds and all was well:
❯ verdi config set daemon.timeout 20
Success: 'daemon.timeout' set to 20 for 'dev' profile
❯ verdi daemon restart --reset
Profile: dev
Stopping the daemon... OK
Starting the daemon with 1 workers... OK
Expected behavior
So two suggested action points would be:
- Fix the
--timeout
not being used properly, unless I misunderstand it's purpose? - Increase the default timeout to e.g. 5 or 10.
Your environment
- Operating system [e.g. Linux]: macOS Ventura 13.5.1
- Python version [e.g. 3.7.1]: 3.10.13
- aiida-core version [e.g. 1.2.1]: 2.4.1
- RabbitMQ: 3.12.7
Context
Originally raised in #3800
I tried to solve this issue , there I noticed
TIMEOUT = OverridableOption(
'-t',
'--timeout',
type=click.FLOAT,
default=5.0,
show_default=True,
help='Time in seconds to wait for a response before timing out.',
)
default is already 5.0 should it be increased to 10??
and I feel this change has to be made
If there are any mistakes in the code I provided, please let me know so I can fix them.
This option is now deprecated and will be removed so I am going to close this
Thanks @sphuber. I see the --timeout
flag was removed in https://github.com/aiidateam/aiida-core/commit/8ac6424108d1528bd3279c81da62dd44855b6ebc, since apparently it only had an effect on the "soft" restart mode (i.e. keep the process and restart the workers). But wouldn't we want to have a timeout option for the "hard" restart mode as well?
Could have done, since verdi daemon stop
takes the --timeout
option, but don't think it is that important to be honest