From 80481f756d71bd58b4bda627758dcd774e9d5dcd Mon Sep 17 00:00:00 2001
From: Valery Kharseko <vharseko@3a-systems.ru>
Date: Fri, 18 Sep 2026 14:45:54 +0000
Subject: [PATCH] [#986] Give back the changes a replay thread the pool stopped had parked (#988)

---
 opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/SessionRestartRequests.java |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/SessionRestartRequests.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/SessionRestartRequests.java
index a854b5a..51f13b3 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/SessionRestartRequests.java
+++ b/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.
    *

--
Gitblit v1.10.0