Skip to content

Improve shutdown process #4

@tomcur

Description

@tomcur

Currently, the program does not have a clean shutdown process. When the program exits—which at the moment can only happen due to an exception, e.g. an unhandled exception raised by the code or a termination signal—it can leave resources open.

This happens currently in https://github.com/astroplant/astroplant-peripheral-device-library, where some peripherals open PiGPIO I2C handles, which should be explicitly closed on exit, which they now are not.

There are multiple solutions for this. For example, an explicit shutdown process could be implemented, or peripheral devices could be implemented as/using context managers (though this would likely strongly tie the cleanup procedure to the lexical scope).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions