patroni.watchdog.linux module¶
- class patroni.watchdog.linux.LinuxWatchdogDevice(device: str)¶
Bases:
patroni.watchdog.base.WatchdogBase
- DEFAULT_DEVICE = '/dev/watchdog'¶
- _abc_impl = <_abc._abc_data object>¶
- _ioctl(func: int, arg: Any) None ¶
Runs the specified ioctl on the underlying fd.
Raises WatchdogError if the device is closed. Raises OSError or IOError (Python 2) when the ioctl fails.
- property can_be_disabled: bool¶
Returns True when watchdog will be disabled by calling close(). Some watchdog devices will keep running no matter what once activated. May raise WatchdogError if called without calling open() first.
- classmethod from_config(config: Dict[str, Any]) patroni.watchdog.linux.LinuxWatchdogDevice ¶
- get_support() patroni.watchdog.linux.WatchdogInfo ¶
- property is_running: bool¶
Returns True when watchdog is activated and capable of performing it’s task.
- class patroni.watchdog.linux.TestingWatchdogDevice(device: str)¶
Bases:
patroni.watchdog.linux.LinuxWatchdogDevice
Converts timeout ioctls to regular writes that can be intercepted from a named pipe.
- _abc_impl = <_abc._abc_data object>¶
- get_support() patroni.watchdog.linux.WatchdogInfo ¶
- set_timeout(timeout: int) None ¶
Set the watchdog timer timeout.
- Parameters
timeout – watchdog timeout in seconds
- timeout = 60¶
- class patroni.watchdog.linux.WatchdogInfo(options: int, version: int, identity: str)¶
Bases:
NamedTuple
Watchdog descriptor from the kernel
- _asdict()¶
Return a new dict which maps field names to their values.
- _field_defaults = {}¶
- _fields = ('options', 'version', 'identity')¶
- classmethod _make(iterable)¶
Make a new WatchdogInfo object from a sequence or iterable
- _replace(**kwds)¶
Return a new WatchdogInfo object replacing specified fields with new values
- class patroni.watchdog.linux.watchdog_info¶
Bases:
_ctypes.Structure
- _fields_ = [('options', <class 'ctypes.c_uint'>), ('firmware_version', <class 'ctypes.c_uint'>), ('identity', <class 'patroni.watchdog.linux.c_ubyte_Array_32'>)]¶
- firmware_version¶
Structure/Union member
- identity¶
Structure/Union member
- options¶
Structure/Union member