diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-09-10 17:42:18 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-09-10 17:42:18 +0100 |
commit | 3d97675cf4361d30dd541eff5b6b13c57cf36b80 (patch) | |
tree | 7a52f562628b71c79d62d55e74844272a48c65d6 /src/rspamd.h | |
parent | 19b347c030d09224c72c8c3eae76f2d8f6dd085c (diff) | |
download | rspamd-3d97675cf4361d30dd541eff5b6b13c57cf36b80.tar.gz rspamd-3d97675cf4361d30dd541eff5b6b13c57cf36b80.zip |
[Project] Add preliminary support of the heartbeats
Diffstat (limited to 'src/rspamd.h')
-rw-r--r-- | src/rspamd.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/rspamd.h b/src/rspamd.h index ea11965fb..3cd6c391b 100644 --- a/src/rspamd.h +++ b/src/rspamd.h @@ -76,6 +76,12 @@ struct rspamd_worker_accept_event { typedef void (*rspamd_worker_term_cb) (EV_P_ ev_child *, struct rspamd_main *, struct rspamd_worker *); +struct rspamd_worker_heartbeat { + ev_timer heartbeat_ev; /**< used by main for checking heartbeats and by workers to send heartbeats */ + ev_tstamp last_event; + gint64 nbeats; /* positive for beats received, negative for beats missed */ +}; + /** * Worker process structure */ @@ -90,7 +96,7 @@ struct rspamd_worker { struct rspamd_main *srv; /**< pointer to server structure */ GQuark type; /**< process type */ GHashTable *signal_events; /**< signal events */ - struct rspamd_worker_accept_event *accept_events; /**< socket events */ + struct rspamd_worker_accept_event *accept_events; /**< socket events */ struct rspamd_worker_conf *cf; /**< worker config data */ gpointer ctx; /**< worker's specific data */ enum rspamd_worker_flags flags; /**< worker's flags */ @@ -99,6 +105,7 @@ struct rspamd_worker { gint srv_pipe[2]; /**< used by workers to request something from the main process. [0] - main, [1] - worker */ ev_io srv_ev; /**< used by main for read workers' requests */ + struct rspamd_worker_heartbeat hb; /**< heartbeat data */ gpointer control_data; /**< used by control protocol to handle commands */ gpointer tmp_data; /**< used to avoid race condition to deal with control messages */ GPtrArray *finish_actions; /**< called when worker is terminated */ |