Re: Why org.apache.tomcat.util.threads.TaskQueue#offer doesn't have synchronized modifier?

2022-04-25 Thread zrlw
a large number of http requests: 400+

Re: Why org.apache.tomcat.util.threads.TaskQueue#offer doesn't have synchronized modifier?

2022-04-20 Thread zrlw
> TaskQueue extendsLinkedBlockingQueue and most calls to TaskQueue.offer end up 
> callingsuper.offer which provides the necessary thread-safety.

2. the issue is that TaskQueue.offer return false directly instead of calling 
supper.offer when huge requests (more than maximum pool size, but current pool 
size is less than max) arrived at the same time.

Re: Why org.apache.tomcat.util.threads.TaskQueue#offer doesn't have synchronized modifier?

2022-04-20 Thread zrlw

- Original Message -
From: Christopher Schultz 
To: users@tomcat.apache.org
Subject: Re: Why org.apache.tomcat.util.threads.TaskQueue#offer doesn't have 
synchronized modifier?
Date: 2022-04-20 01:32
1. "server.tomcat.max-threads" is a setting which is defined in 
spring-configuration-metadata.json for 
org.springframework.boot.autoconfigure.web.ServerProperties#Tomcat 
(spring-boot-autoconfigure-xxx.RELEASE.jar), which indicated maximum amount of 
tomcat worker threads. we define only one tomcat port at application.yml so 
there are only one connector.

Why org.apache.tomcat.util.threads.TaskQueue#offer doesn't have synchronized modifier?

2022-04-18 Thread zrlw
Tomcat version: 
9.0.62https://github.com/apache/tomcat/blob/9.0.62/java/org/apache/tomcat/util/threads/TaskQueue.java#L116
//if we have less threads than maximum force creation of a new thread   
 if (parent.getPoolSize()