tarantool / watchdog

tarantool watchdog module

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple watchdog module for Tarantool

The watchdog module is useful when the responsiveness of the system is important.

The watchdog module spawns a thread and continuously checks the value of an internal variable. The variable is updated periodically by a separate tarantool fiber.

The watchdog observation period is hardcoded to be 200ms. The fiber update period equals to 1/4 of the timeout parameter. Depending of precise timings, the real timeout event may occur from timeout to 1.25 * timeout seconds.

Whenever a problem with an update fiber occurs the watchdog thread performs exit(6) if coredump is disabled otherwise abort(). The problem may be caused by using blocking signals or by mistakes in other modules (e.g. while true ... end)

Installing

$ tarantoolctl rocks install watchdog

Usage

local watchdog = require('watchdog')
watchdog.start(1) -- timeout in seconds (double)
watchdog.start(1, true) -- timeout in seconds (double) and coredump is enabled

Examining coredump

See: https://github.com/tarantool/luajit/blob/tarantool/src/luajit-gdb.py

About

tarantool watchdog module

License:BSD 2-Clause "Simplified" License


Languages

Language:C 38.5%Language:CMake 30.8%Language:Lua 27.3%Language:Shell 3.4%