Project

General

Profile

Idea #15267

Improve error handling in DAQInterface

Added by John Freeman almost 3 years ago. Updated almost 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
artdaq-daqinterface
Target version:
-
Start date:
01/20/2017
Due date:
% Done:

100%

Estimated time:
10.00 h
Experiment:
-
Duration:

Description

Right now, under certain error conditions, DAQInterface will shut down, but a thread of execution will continue at the same time as the shutting-down procedure, creating excessive output and making it more difficult to find the error message. Worse, even if all the artdaq processes have been killed, DAQInterface can think that it isn't in fact in the stopped state, and will refuse to take transitions you should be able to pass to it when it's in stopped (i.e., the boot transition). The following goals should be met for the way DAQInterface handles error conditions:

-If the error occurs in a function directly called externally (e.g., a transition function), it should either try to print a warning and restore the state to before the function call, or print an error message and put itself into the stopped state.

-If the error occurs in a function called by another DAQInterface function, that error should be handled by an exception throw, rather than directly causing a shutdown. It's because of this that the phenomenon above can occur i.e., the called function requests that DAQInterface shuts down into the stopped state and returns, but the callee is unaware there was a problem and continues execution.

History

#1 Updated by John Freeman almost 3 years ago

  • % Done changed from 0 to 100

While it's always possible to make improvements (https://en.wikipedia.org/wiki/Kaizen) with commit 32cc52fbf0a9dd537f615816df75bde581527a80 of artdaq-utilities-daqinterface, most of the needs for improved error handling as described above have been satisfied: where possible, exceptions will no longer escape the user-called transition functions but will either be handled internally, resulting in a reversion to the previous state before the failed transition was requested, or will result in DAQInterface shutting itself down into the "stopped" state.

#2 Updated by John Freeman almost 3 years ago

  • Status changed from New to Resolved

#3 Updated by Eric Flumerfelt almost 3 years ago

  • Category set to artdaq-daqinterface


Also available in: Atom PDF