From e12785f91bb0645264eeb0a9144b4773c64eea8e Mon Sep 17 00:00:00 2001 From: rvazarkar Date: Fri, 2 Feb 2024 15:06:43 -0500 Subject: [PATCH] chore: more comment --- src/CommonLib/LDAPUtils.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/CommonLib/LDAPUtils.cs b/src/CommonLib/LDAPUtils.cs index c0e2ace3..cd9851ca 100644 --- a/src/CommonLib/LDAPUtils.cs +++ b/src/CommonLib/LDAPUtils.cs @@ -879,7 +879,9 @@ public IEnumerable QueryLDAP(string ldapFilter, SearchScope while the other threads that hit the ServerDown exception simply wait. The initial caller will hold the semaphore and do a backoff delay before trying to make a new connection which will replace the existing connection in the _ldapConnections cache. Other threads will retrieve the new connection from the cache instead of making a new one - This minimizes overhead of new connections while still fixing our core problem*/ + This minimizes overhead of new connections while still fixing our core problem. + + A CurrentCount of 0 indicates the semaphore is already held because c# semaphores are weird and backwards*/ var isSemaphoreHeld = _semaphoreSlim.CurrentCount == 0; //Always increment retry count retryCount++;