mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Nicolas Capponi
19.08.2014 705e6161ec492a9c3e537188125f9b7a2d8761d2
OPENDJ-1672 CR-5726 Fix NoSuchElementException in RS when adding big entries
1 files modified
9 ■■■■ changed files
opendj-sdk/opendj3-server-dev/src/server/org/opends/server/replication/server/MessageHandler.java 9 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj3-server-dev/src/server/org/opends/server/replication/server/MessageHandler.java
@@ -69,6 +69,9 @@
{
  /** The logger of this class. */
  protected static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
  private static final int MINIMUM_TRESHOLD_MSG_QUEUE_SIZE = 5;
  /**
   * UpdateMsg queue.
   */
@@ -174,8 +177,10 @@
  private boolean isMsgQueueAboveThreshold()
  {
    return msgQueue.count() > maxQueueSize
        || msgQueue.bytesCount() > maxQueueBytesSize;
    final long count = msgQueue.count();
    // ensure there is a minimum number of messages in queue to avoid wrong behavior
    return count > maxQueueSize
        || (count >= MINIMUM_TRESHOLD_MSG_QUEUE_SIZE && msgQueue.bytesCount() > maxQueueBytesSize);
  }
  private boolean isMsgQueueBelowThreshold()