Commit Graph

5 Commits

Author SHA1 Message Date
Jan Friesse
28d49141f8 qnetd: Move client schedule disconnect handling
Client disconnect used to be per client fd in
the qnetd_client_net_socket_poll_loop_set_events_cb. Problem is, that
disconnect calls algorithm which may send message to other client
with fd which was already processed in the pr-poll-loop so POLLOUT is
not set till new loop exec is called (and that usually happens
because old one timeouts). To reproduce this problem use
ffsplit and make qnetd disconnect one of the clients - ffsplit
needs to send ack/nack votes, but it doesn't send them during
first iteration and waits for dpd timeout.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2020-11-18 17:58:34 +01:00
Jan Friesse
a8b7513df9 qnetd: Improve dead peer detection
Previously dead peer detection timer was scheduled every dpd_interval,
added dpd_interval to all of the clients timestamp and if timestamp was
larger than client hearbeat interval * 1.2 then check if client sent
some message. If so, flag was reset.

This method was source of number of problems so instead different method
is now used.

Every single client has its own timer with timeout based on
(configurable) dpd_interval_coefficient and multiplied with
client heartbeat timeout. When message is received from client timer is
rescheduled. When timer callback is called (= client doesn't sent
message during timeout) then client is disconnected.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2020-11-18 15:05:21 +01:00
Jan Friesse
6f55a0649f qnetd: Migrate main loop to pr-poll-loop
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2020-08-12 15:52:17 +02:00
Jan Friesse
bb9dabf945 qnetd: Rename qnetd-log.c to log.c
And remove qnetd_ prefix from function names.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2019-08-12 17:47:39 +02:00
Jan Friesse
9a1955a7d6 Initial import from corosync codebase
Used the code from corosync master
(31ddba64a2726bcedf81eb84df2e2da4846832f7)

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
2018-01-23 14:24:36 +01:00