Jetty service Thread crashes and uses 100% CPU

2019-08-02 06:15发布

I have a strange problem with Jetty. After a while, serving requests, the CPU usage goes to 100%. I have found the thread responsible, and here are a few samples of its stack trace taken in eclipse:

SocketInputStream.read(byte[], int, int) line: 113  
ByteArrayBuffer.readFrom(InputStream, int) line: 388    
SocketConnector$ConnectorEndPoint(StreamEndPoint).fill(Buffer) line: 132    
SocketConnector$ConnectorEndPoint.fill(Buffer) line: 209    
HttpParser.parseNext() line: 289    
HttpParser.parseAvailable() line: 214   
HttpConnection.handle() line: 411   
SocketConnector$ConnectorEndPoint.run() line: 241   
QueuedThreadPool$3.run() line: 529  
Thread.run() line: 680

Throwable.fillInStackTrace() line: not available [native method]    
SocketException(Throwable).<init>(String) line: 196 
SocketException(Exception).<init>(String) line: 41  
SocketException(IOException).<init>(String) line: 41    
SocketException.<init>(String) line: 29 
SocketInputStream.read(byte[], int, int) line: 113  
ByteArrayBuffer.readFrom(InputStream, int) line: 388    
SocketConnector$ConnectorEndPoint(StreamEndPoint).fill(Buffer) line: 132    
SocketConnector$ConnectorEndPoint.fill(Buffer) line: 209    
HttpParser.parseNext() line: 289    
HttpParser.parseAvailable() line: 214   
HttpConnection.handle() line: 411   
SocketConnector$ConnectorEndPoint.run() line: 241   
QueuedThreadPool$3.run() line: 529  
Thread.run() line: 680  

ByteArrayBuffer.readFrom(InputStream, int) line: 388    
SocketConnector$ConnectorEndPoint(StreamEndPoint).fill(Buffer) line: 132    
SocketConnector$ConnectorEndPoint.fill(Buffer) line: 209    
HttpParser.parseNext() line: 289    
HttpParser.parseAvailable() line: 214   
HttpConnection.handle() line: 411   
SocketConnector$ConnectorEndPoint.run() line: 241   
QueuedThreadPool$3.run() line: 529  
Thread.run() line: 680  

SocketConnector$ConnectorEndPoint.fill(Buffer) line: 209    
HttpParser.parseNext() line: 289    
HttpParser.parseAvailable() line: 214   
HttpConnection.handle() line: 411   
SocketConnector$ConnectorEndPoint.run() line: 241   
QueuedThreadPool$3.run() line: 529  
Thread.run() line: 680  

These traces were taken with no clients connected, that is, it was sufficient to re-start the affected Thread and suspend it again to take the stack trace. Anyone have any ideas?

Edit: Is this related, I wonder: How to get Jetty thread dump?

标签: java http Jetty
1条回答
淡お忘
2楼-- · 2019-08-02 06:50

How long does it run before it does this?

Are you starting the JVM with the -server switch? I would recommend doing so if you're not.

To me this sounds like a Jetty bug. Can maybe try searching their archives.

查看更多
登录 后发表回答