opends/src/server/org/opends/server/replication/server/ServerHandler.java
@@ -145,7 +145,7 @@ /** * The associated ServerWriter that sends messages to the remote server. */ protected ServerWriter writer = null; protected ServerWriter writer; /** * The associated ServerReader that receives messages from the remote server. @@ -202,7 +202,7 @@ /** * Set when ServerWriter is stopping. */ protected boolean shutdownWriter = false; protected volatile boolean shutdownWriter = false; /** * Weight of this remote server. opends/src/server/org/opends/server/replication/server/changelog/je/ChangeNumberIndexer.java
@@ -365,6 +365,7 @@ if (doClear.get()) { removeAllCursors(); resetNextChangeForInsertDBCursor(); // No need to use CAS here because it is only for unit tests and at // this point all will have been cleaned up anyway. doClear.set(false); @@ -434,7 +435,6 @@ Thread.currentThread().interrupt(); } } removeAllCursors(); } catch (ChangelogException e) { @@ -448,6 +448,10 @@ TRACER.debugCaught(DebugLogLevel.ERROR, e); // TODO JNR error message i18n } finally { removeAllCursors(); } } private void moveForwardMediumConsistencyPoint(final CSN csn, final DN baseDN) @@ -467,15 +471,19 @@ } } private void removeAllCursors() throws ChangelogException private void removeAllCursors() { if (nextChangeForInsertDBCursor != null) { nextChangeForInsertDBCursor.close(); nextChangeForInsertDBCursor = null; } for (Map<Integer, DBCursor<UpdateMsg>> map : allCursors.values()) { StaticUtils.close(map.values()); } allCursors.clear(); newCursors.clear(); resetNextChangeForInsertDBCursor(); } private void removeCursor(final DN baseDN, final CSN csn) opends/src/server/org/opends/server/replication/server/changelog/je/JEReplicaDBCursor.java
@@ -96,7 +96,15 @@ @Override public boolean next() throws ChangelogException { if (cursor != null) { currentChange = cursor.next(); } else { currentChange = null; } if (currentChange != null) {