This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new d1319a3628 Add debug log when going above a configured latch limit
d1319a3628 is described below
commit d1319a36284d0fa8b851e35b1716ba9bbd15dcdb
Author: remm <[email protected]>
AuthorDate: Tue Apr 23 16:31:11 2024 +0200
Add debug log when going above a configured latch limit
---
java/org/apache/tomcat/util/threads/LimitLatch.java | 5 +++++
java/org/apache/tomcat/util/threads/LocalStrings.properties | 2 ++
webapps/docs/changelog.xml | 4 ++++
3 files changed, 11 insertions(+)
diff --git a/java/org/apache/tomcat/util/threads/LimitLatch.java
b/java/org/apache/tomcat/util/threads/LimitLatch.java
index 06675dd15d..5eea56aad1 100644
--- a/java/org/apache/tomcat/util/threads/LimitLatch.java
+++ b/java/org/apache/tomcat/util/threads/LimitLatch.java
@@ -22,6 +22,7 @@ import java.util.concurrent.locks.AbstractQueuedSynchronizer;
import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.util.res.StringManager;
/**
* Shared latch that allows the latch to be acquired a limited number of times
@@ -31,6 +32,7 @@ import org.apache.juli.logging.LogFactory;
public class LimitLatch {
private static final Log log = LogFactory.getLog(LimitLatch.class);
+ private static final StringManager sm =
StringManager.getManager(LimitLatch.class);
private class Sync extends AbstractQueuedSynchronizer {
private static final long serialVersionUID = 1L;
@@ -42,6 +44,9 @@ public class LimitLatch {
protected int tryAcquireShared(int ignored) {
long newCount = count.incrementAndGet();
if (!released && newCount > limit) {
+ if (log.isDebugEnabled()) {
+ log.debug(sm.getString("limitLatch.exceeded",
Long.valueOf(limit)));
+ }
// Limit exceeded
count.decrementAndGet();
return -1;
diff --git a/java/org/apache/tomcat/util/threads/LocalStrings.properties
b/java/org/apache/tomcat/util/threads/LocalStrings.properties
index 53856f58a0..5c79a42bd0 100644
--- a/java/org/apache/tomcat/util/threads/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/threads/LocalStrings.properties
@@ -13,6 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+limitLatch.exceeded=Latch limit [{0}] exceeded
+
taskQueue.notRunning=Executor not running, can't force a command into the queue
taskThread.exiting=Thread exiting on purpose
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 036fed1454..b27c12dbe9 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -169,6 +169,10 @@
request body uses chunked encoding and is read using non-blocking IO.
(markt)
</fix>
+ <fix>
+ <bug>68934</bug>: Add debug logging in the latch object when exceeding
+ <code>maxConnections</code>. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Other">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]