From 9b8c72c44650f2dc29662af60e970b192050cd2e Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Wed, 21 Oct 2009 15:20:55 +1100 Subject: When clients have blocked, perhaps because the node is banned or stopped and the client is blocked trying to tdb_fetch() a record, make sure we dont queue up too many REQ_MESSAGES. Add a new tunable to control the maximum queue size we allow to a blocked client before we start discarding REQ_MESSAGES instead of queueing them for delivery. This avoids having queued up very very large number of MESSAGES that samba semds between eachother to nodes that are blocked/banned/stopped for extended periods . (This used to be ctdb commit f76d6fed8f9630450263b9fa4b5fdf3493fb1e11) --- ctdb/common/ctdb_io.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ctdb/common/ctdb_io.c') diff --git a/ctdb/common/ctdb_io.c b/ctdb/common/ctdb_io.c index 3377aa13338..ea7c17d0198 100644 --- a/ctdb/common/ctdb_io.c +++ b/ctdb/common/ctdb_io.c @@ -55,6 +55,16 @@ struct ctdb_queue { +int ctdb_queue_length(struct ctdb_queue *queue) +{ + int i; + struct ctdb_queue_pkt *pkt; + + for(i=0, pkt=queue->out_queue;pkt;i++,pkt=pkt->next); + + return i; +} + /* called when an incoming connection is readable */ -- cgit