summaryrefslogtreecommitdiffstats
path: root/ctdb/common/ctdb_io.c
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronniesahlberg@gmail.com>2009-10-21 15:20:55 +1100
committerRonnie Sahlberg <ronniesahlberg@gmail.com>2009-10-21 15:20:55 +1100
commit9b8c72c44650f2dc29662af60e970b192050cd2e (patch)
tree2d19e19fc0fbb54ee2d1e2bd41ca9e053bb5cc3c /ctdb/common/ctdb_io.c
parent149ea4e57785046c80c39f802f85df258fe6d2ef (diff)
downloadsamba-9b8c72c44650f2dc29662af60e970b192050cd2e.tar.gz
samba-9b8c72c44650f2dc29662af60e970b192050cd2e.tar.xz
samba-9b8c72c44650f2dc29662af60e970b192050cd2e.zip
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)
Diffstat (limited to 'ctdb/common/ctdb_io.c')
-rw-r--r--ctdb/common/ctdb_io.c10
1 files changed, 10 insertions, 0 deletions
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
*/