Skip to content

More-descriptive error for when a daemon is down #40

Description

@danechever

At the moment, if someone tries to query a keyword while the daemon is down, they get a generic request timed out error. This is the same message I've seen for many other libby errors, which makes it hard to know/realize that the underlying issue in this case is just that the daemon is down. If possible, it would be great to catch when the issue is just that the daemon is down and provide a more-descriptive/clearer error message for this specific case.

In case it's helpful, here is an example of what I'm describing. I first stop the ATCFW service, confirm it was dead, then try to query keywords and get the timeout. Afterwards I restart the service and show that the same exact keyword query works again.

(hispec-venv) hsdev@hispecserver:~$ systemctl stop hispec-daemon@hsfei_atcfw.service 
(hispec-venv) hsdev@hispecserver:~$ systemctl list-units 'hispec-daemon@*' --all
  UNIT                                 LOAD   ACTIVE   SUB     DESCRIPTION                            
  hispec-daemon@hsfei_adc.service      loaded active   running HISPEC hardware daemon (hsfei_adc)
  hispec-daemon@hsfei_atcfw.service    loaded inactive dead    HISPEC hardware daemon (hsfei_atcfw)
  hispec-daemon@hsfei_atcl.service     loaded active   running HISPEC hardware daemon (hsfei_atcl)
  hispec-daemon@hsfei_atcp.service     loaded active   running HISPEC hardware daemon (hsfei_atcp)
  hispec-daemon@hsfei_atcpress.service loaded active   running HISPEC hardware daemon (hsfei_atcpress)
● hispec-daemon@hsfei_atctherm.service loaded failed   failed  HISPEC hardware daemon (hsfei_atctherm)
  hispec-daemon@hsfei_hkfam.service    loaded active   running HISPEC hardware daemon (hsfei_hkfam)
  hispec-daemon@hsfei_lsm.service      loaded active   running HISPEC hardware daemon (hsfei_lsm)
  hispec-daemon@hsfei_ms.service       loaded active   running HISPEC hardware daemon (hsfei_ms)

Legend: LOAD   → Reflects whether the unit definition was properly loaded.
        ACTIVE → The high-level unit activation state, i.e. generalization of SUB.
        SUB    → The low-level unit activation state, values depend on unit type.

9 loaded units listed.
To show all installed unit files use 'systemctl list-unit-files'.
(hispec-venv) hsdev@hispecserver:~$ libby show hsfei.atcfw.positionnamed
libby: hsfei.atcfw.positionnamed: request timed out
(hispec-venv) hsdev@hispecserver:~$ libby show hsfei.atcfw.%
libby: hsfei.atcfw.%: request timed out
(hispec-venv) hsdev@hispecserver:~$ systemctl start hispec-daemon@hsfei_atcfw.service 
(hispec-venv) hsdev@hispecserver:~$ systemctl list-units 'hispec-daemon@*' --all
  UNIT                                 LOAD   ACTIVE SUB     DESCRIPTION                            
  hispec-daemon@hsfei_adc.service      loaded active running HISPEC hardware daemon (hsfei_adc)
  hispec-daemon@hsfei_atcfw.service    loaded active running HISPEC hardware daemon (hsfei_atcfw)
  hispec-daemon@hsfei_atcl.service     loaded active running HISPEC hardware daemon (hsfei_atcl)
  hispec-daemon@hsfei_atcp.service     loaded active running HISPEC hardware daemon (hsfei_atcp)
  hispec-daemon@hsfei_atcpress.service loaded active running HISPEC hardware daemon (hsfei_atcpress)
● hispec-daemon@hsfei_atctherm.service loaded failed failed  HISPEC hardware daemon (hsfei_atctherm)
  hispec-daemon@hsfei_hkfam.service    loaded active running HISPEC hardware daemon (hsfei_hkfam)
  hispec-daemon@hsfei_lsm.service      loaded active running HISPEC hardware daemon (hsfei_lsm)
  hispec-daemon@hsfei_ms.service       loaded active running HISPEC hardware daemon (hsfei_ms)

Legend: LOAD   → Reflects whether the unit definition was properly loaded.
        ACTIVE → The high-level unit activation state, i.e. generalization of SUB.
        SUB    → The low-level unit activation state, values depend on unit type.

9 loaded units listed.
To show all installed unit files use 'systemctl list-unit-files'.
(hispec-venv) hsdev@hispecserver:~$ libby show hsfei.atcfw.positionnamed
hsfei.atcfw.positionnamed = OD5
(hispec-venv) hsdev@hispecserver:~$ libby show hsfei.atcfw.%
hsfei.atcfw.error         = 
hsfei.atcfw.hardmax       = 6
hsfei.atcfw.hardmin       = 1
hsfei.atcfw.isconnected   = True
hsfei.atcfw.islighton     = False
hsfei.atcfw.lasterror     = None
hsfei.atcfw.nfilters      = 0
hsfei.atcfw.positionnamed = OD5
hsfei.atcfw.positionvalue = 5
hsfei.atcfw.shutdown      = False
hsfei.atcfw.softmax       = 6
hsfei.atcfw.softmin       = 1
hsfei.atcfw.uptime        = 17 seconds
(hispec-venv) hsdev@hispecserver:~$ 

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions