Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jetty (embedded) rejected warning logs #10327

Closed
kpandey408 opened this issue Aug 16, 2023 · 6 comments · Fixed by #10362
Closed

Jetty (embedded) rejected warning logs #10327

kpandey408 opened this issue Aug 16, 2023 · 6 comments · Fixed by #10362

Comments

@kpandey408
Copy link

Jetty version(s)
jetty.version>9.4.43.v20210629
Jetty Environment

Java version/vendor (use: java -version)
java-8 (open JDK 1.8.0_232)
OS type/version
OS_NAME="Linux"
OS_VERSION="2.6"
OS_ARCH="amd64"
Description
Recently I was trying to investigate some random 502 (GCP load balancer logs says backend_connection_closed_before_data_sent_to_client)

Found log of following errors in google log console (Note: number of 502 is very low compared to such warnings).

QueuedThreadPool[qtp341239255]@1456e5d7{STARTED,150<=150<=150,i=94,r=-1,q=0}[ReservedThreadExecutor@7092d376{s=0/2,p=2}] rejected CEP:SocketChannelEndPoint@ebb1a67{l=/10.142.64.185:17002,r=/35.191.10.133:50514,OPEN,fill=FI,flush=-,to=152431/620000}{io=1/0,kio=1,kro=1}->HttpConnection@5f666777[p=HttpParser{s=START,0 of -1},g=HttpGenerator@644af3fc{s=START}]=>HttpChannelOverHttp@5f96b225{s=HttpChannelState@70f5fd01{s=IDLE rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=true al=0},r=60,c=false/false,a=IDLE,uri=null,age=0}:runFillable:BLOCKING

min=max=150(threads), queue capacity=150
From the log queue is empty and threads are available,
Any suggestions why above warning are in the logs even if there seems to be not too much traffic.

How to reproduce?

@kpandey408 kpandey408 added the Bug For general bugs on Jetty side label Aug 16, 2023
@joakime joakime added Question End-of-Life release and removed Bug For general bugs on Jetty side labels Aug 16, 2023
@joakime
Copy link
Contributor

joakime commented Aug 16, 2023

Jetty 9.x is now at End of Community Support

You should be using Jetty 10, Jetty 11, or even Jetty 12 at this point in time.

@kpandey408
Copy link
Author

kpandey408 commented Aug 16, 2023 via email

@joakime
Copy link
Contributor

joakime commented Aug 16, 2023

@kpandey408 some general advice ...

  1. Don't use a BlockingQueue with a bound upper limit with QueuedThreadPool.

  2. Monitor your QueuedThreadPool numbers (there's lots of information present in JMX for it), over time you'll want to adjust the configuration of your QueuedThreadPool as usage of your web application changes (especially in your case, as you are not running with a default configuration, and your server seems to want to run with a reduced configuration for some reason)

  3. Keep up to date with Jetty. Your version (9.4.43) is vulnerable to several CVEs at this point in time. - https://eclipse.dev/jetty/security_reports.php

  4. Keep up to date with Java. Your version (1.8.0_232) has none of the SSL/TLS changes to support the rapidly changing landscape with SSL/TLS/Crypto that the wider internet has already updated to. - https://www.java.com/en/jre-jdk-cryptoroadmap.html

@kpandey408
Copy link
Author

kpandey408 commented Aug 17, 2023 via email

@joakime
Copy link
Contributor

joakime commented Aug 17, 2023

Attempting to control limits by tweaking threading is 100% the wrong way to go.
Jetty is a 100% async server, tweaking/limiting threading just means you will break in thousands of unexpected ways that have nothing to do with controlling limits.

There are other techniques to manage too many requests.
Connection limits, DOS handlers, QOS handlers, Low Resource monitors, etc...

sbordet added a commit that referenced this issue Aug 23, 2023
Added documentation about the fact that the QTP queue should be unbounded.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
@sbordet sbordet linked a pull request Aug 23, 2023 that will close this issue
sbordet added a commit that referenced this issue Aug 24, 2023
Added documentation about the fact that the QTP queue should be unbounded.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
@sbordet
Copy link
Contributor

sbordet commented Aug 25, 2023

@kpandey408 I have updated the documentation to explain why the thread pool queue should be unbounded.

@sbordet sbordet closed this as completed Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants