SKA-ScienceDataProcessor / integration-prototype

SDP Integration Prototype
BSD 3-Clause "New" or "Revised" License
4 stars 7 forks source link

Trying to go from standby to disable causes critical error #91

Open david-terrett opened 5 years ago

david-terrett commented 5 years ago

If the master controller is in standby and the target state is set to disable the master controller dies with a CRITICAL error

To Reproduce

  1. Follow the 01_states_demo until you have an iTango proxy device
  2. md.target_state = 'standby'
  3. md.target_state = 'disable'

The master controller logs a CRITICAL error and then exits.

Expected behavior Either the master controller changes state or an error is reported.

Screenshots &/or terminal output

2019-03-18 11:51:34,401 - sip.ec.master_controller - INFO - SDP target state changed to 'disable'
2019-03-18 11:51:34,483 - sip.ec.master_controller - INFO - Processing target state change request ...
2019-03-18 11:51:34,587 - sip.ec.master_controller - INFO - Done processing target state change request!
2019-03-18 11:51:34,588 - sip.ec.master_controller - CRITICAL - Value error: Invalid current state update: 'disable'. 'standby' can be transitioned to states: ['off', 'on', 'alarm', 'fault', 'standby']
2019-03-18 11:51:34,589 - sip.ec.master_controller - INFO - Exiting!

Context

david-terrett commented 5 years ago

Setting the request state to any invalid value appears to result in the same behaviour.

bmort commented 5 years ago

yup clearly an issue here. As you no doubt spotted, the error is being thrown from the config DB API. According to the SDP state diagram going from standby to disabled is not an allowed transition so this is somewhat expected, although maybe we should revisit the discussion on that logic.

That aside, the main issue here is that the Value Error being thrown when an invalid transition is requested is not being handled appropriately by the Master Controller. I'm not sure on all the edge cases but it's pretty clear that just exiting the whole application is not a reasonable outcome.