Blame SOURCES/0006-Ticket-48767-flow-control-in-replication-also-blocks.patch

7c7f29
From 05b04751367b628819d6f0a5a533d1af4eb423ba Mon Sep 17 00:00:00 2001
7c7f29
From: Mark Reynolds <mreynolds@redhat.com>
7c7f29
Date: Mon, 11 Jul 2016 10:30:04 -0400
7c7f29
Subject: [PATCH 06/15] Ticket 48767 - flow control in replication also blocks
7c7f29
 receiving results
7c7f29
7c7f29
Bug Description: In ticket 47942 a flow control was introduced to reduce
7c7f29
                 the load of a replication consumer.  It adds some pauses
7c7f29
                 in the asynch sending of updates.  Unfortunately while it
7c7f29
                 pauses it holds the reader lock, so that the result reader
7c7f29
                 thread is also paused.
7c7f29
7c7f29
Fix Description: If we need to pause the sending of updates then also release
7c7f29
                 the Result Data lock so the reader thread is not blocked.
7c7f29
7c7f29
https://fedorahosted.org/389/ticket/48767
7c7f29
7c7f29
Reviewed by: nhosi(Thanks!)
7c7f29
7c7f29
(cherry picked from commit ba636587e77423c7773df60894344dea0377c36f)
7c7f29
---
7c7f29
 ldap/servers/plugins/replication/repl5_inc_protocol.c | 4 +++-
7c7f29
 1 file changed, 3 insertions(+), 1 deletion(-)
7c7f29
7c7f29
diff --git a/ldap/servers/plugins/replication/repl5_inc_protocol.c b/ldap/servers/plugins/replication/repl5_inc_protocol.c
7c7f29
index d6fb898..27bac5d 100644
7c7f29
--- a/ldap/servers/plugins/replication/repl5_inc_protocol.c
7c7f29
+++ b/ldap/servers/plugins/replication/repl5_inc_protocol.c
7c7f29
@@ -479,9 +479,11 @@ repl5_inc_flow_control_results(Repl_Agmt *agmt, result_data *rd)
7c7f29
     if ((rd->last_message_id_received <= rd->last_message_id_sent) &&
7c7f29
         ((rd->last_message_id_sent - rd->last_message_id_received) >= agmt_get_flowcontrolwindow(agmt))) {
7c7f29
         rd->flowcontrol_detection++;
7c7f29
+        PR_Unlock(rd->lock);
7c7f29
         DS_Sleep(PR_MillisecondsToInterval(agmt_get_flowcontrolpause(agmt)));
7c7f29
+    } else {
7c7f29
+        PR_Unlock(rd->lock);
7c7f29
     }
7c7f29
-    PR_Unlock(rd->lock);
7c7f29
 }
7c7f29
 
7c7f29
 static int
7c7f29
-- 
7c7f29
2.4.11
7c7f29