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

Valery Kharseko
2 days ago 80481f756d71bd58b4bda627758dcd774e9d5dcd
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/SessionRestartRequests.java
@@ -58,6 +58,21 @@
  private final AtomicReference<SessionRestart> requested =
      new AtomicReference<>(SessionRestart.NONE);
  SessionRestartRequests()
  {
    /*
     * Every request is made on a replay-failure road, where an allocation may be what has
     * just failed, and the first execution of merge() in a JVM allocates: the call site
     * of its lambda and the VarHandle site inside accumulateAndGet() are linked when they
     * are first run, and nothing runs them before a replay fails. Run once here, on a
     * thread which can allocate, so that a request made on the road out of an
     * OutOfMemoryError asks for nothing the JVM has just refused (issue #954). The same
     * goes for what takes a request, which is run on the same roads.
     */
    merge(SessionRestart.NONE);
    take();
  }
  /**
   * Asks this domain to restart its session.
   *