DiamondLightSource / tickit

Event-based hardware simulation framework
Apache License 2.0
7 stars 0 forks source link

Exceptions in Device.update() are ignored #105

Closed MJGaughran closed 1 year ago

MJGaughran commented 1 year ago

Any exceptions produced by Device.update() get ignored in tickit.

It is easy to demonstrate this with the example ShutterDevice. Add the following to the beginning of the update() method:

        logging.error("Exit here")
        sys.exit(-1)

Run the example using e.g.

python -m tickit all ./examples/configs/shutter.yaml

You will see the application quickly exit with the logged message. On the other hand, if you use:

        raise Exception("This will not get reported")
        logging.error("Exit here")
        sys.exit(-1)

You will see no message, and the application will continue to behave as though there were no error. It will continue to receive and handle requests.

In my own case similar to the above, the first error was in tickit.core.management.schedulers.master.MasterScheduler, as it did not initialise self.last_time properly. This only appeared after I sent a command to the device.

abbiemery commented 1 year ago

Closed with PR #115