From 9e1f377c4f21b899d16f4c62450c68691f4b42a8 Mon Sep 17 00:00:00 2001
From: Ludovic Poitou <ludovic.poitou@forgerock.com>
Date: Thu, 20 Jun 2013 15:02:35 +0000
Subject: [PATCH] Fix for OPENDJ-846, Intermittent Replication failure. The issue was triggered by the mix of AssuredReplication and bad network conditions, which resulted in a deadlock between 2 RS, as both were blocked on writing to the TCP socket and not reading (because waiting on the write lock). The solution (more of a workaround) is to have another thread for sending data to the socket and have the reader and writer posting data to send to a queue that this new thread is polling. There are still potential deadlocks but they will occur much later, if the sendQueue gets full. The code needs more work post 2.6 to be fully non blocking, but the changes are enough for now to resolve the customer deadlock case.
---
opends/src/server/org/opends/server/replication/server/ServerWriter.java | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/opends/src/server/org/opends/server/replication/server/ServerWriter.java b/opends/src/server/org/opends/server/replication/server/ServerWriter.java
index 4aae7d7..cd6ed72 100644
--- a/opends/src/server/org/opends/server/replication/server/ServerWriter.java
+++ b/opends/src/server/org/opends/server/replication/server/ServerWriter.java
@@ -40,7 +40,7 @@
import org.opends.server.api.DirectoryThread;
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.replication.common.ServerStatus;
-import org.opends.server.replication.protocol.ProtocolSession;
+import org.opends.server.replication.protocol.Session;
import org.opends.server.replication.protocol.UpdateMsg;
@@ -55,7 +55,7 @@
*/
private static final DebugTracer TRACER = getTracer();
- private final ProtocolSession session;
+ private final Session session;
private final ServerHandler handler;
private final ReplicationServerDomain replicationServerDomain;
@@ -66,13 +66,13 @@
* for new updates and forward them to the server
*
* @param session
- * the ProtocolSession that will be used to send updates.
+ * the Session that will be used to send updates.
* @param handler
* handler for which the ServerWriter is created.
* @param replicationServerDomain
* The ReplicationServerDomain of this ServerWriter.
*/
- public ServerWriter(ProtocolSession session, ServerHandler handler,
+ public ServerWriter(Session session, ServerHandler handler,
ReplicationServerDomain replicationServerDomain)
{
// Session may be null for ECLServerWriter.
--
Gitblit v1.10.0