From 45900e1548fdf2cd81b31a6e328a0925e6f23c13 Mon Sep 17 00:00:00 2001
From: Valery Kharseko <vharseko@3a-systems.ru>
Date: Thu, 09 Jul 2026 09:26:38 +0000
Subject: [PATCH] [#695] Fix race in TraditionalWorkQueue.isIdle() (#688)

---
 opendj-server-legacy/src/main/java/org/opends/server/extensions/TraditionalWorkerThread.java |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/TraditionalWorkerThread.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/TraditionalWorkerThread.java
index 1ceae70..3934f0e 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/TraditionalWorkerThread.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/TraditionalWorkerThread.java
@@ -13,7 +13,7 @@
  *
  * Copyright 2006-2010 Sun Microsystems, Inc.
  * Portions Copyright 2011-2016 ForgeRock AS.
- * Portions Copyright 2025 3A Systems, LLC.
+ * Portions Copyright 2025-2026 3A Systems, LLC.
  */
 package org.opends.server.extensions;
 
@@ -147,6 +147,8 @@
         }
         else
         {
+          try
+          {
           // The operation is not null, so process it.  Make sure that when
           // processing is complete.
 
@@ -172,6 +174,13 @@
             operation.setResultCode(ResultCode.SUCCESS);
             operation.getClientConnection().sendResponse(operation);
           }
+          }
+          finally
+          {
+            // Whatever the outcome, tell the queue this operation is no
+            // longer pending so that isIdle() stays accurate.
+            workQueue.operationDone();
+          }
         }
       }
       catch (Throwable t)

--
Gitblit v1.10.0