Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 367435 - CPU spike in WebSocketConnectionD00
Summary: CPU spike in WebSocketConnectionD00
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: websocket (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 7.5.x   Edit
Assignee: Greg Wilkins CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-22 10:55 EST by jfarcand CLA
Modified: 2012-01-10 20:27 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jfarcand CLA 2011-12-22 10:55:46 EST
Build Identifier: 

CPU is going up (quite up) and we traced the issue is caused by this call.

"qtp1367996500-242" prio=10 tid=0x00002aabc8e49000 nid=0x7c5a runnable [0x0000000046b93000]
   java.lang.Thread.State: RUNNABLE
        at sun.nio.ch.FileDispatcher.read0(Native Method)
        at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:21)
        at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:233)
        at sun.nio.ch.IOUtil.read(IOUtil.java:206)
        at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:236)
        - locked <0x00002aaae6d12568> (a java.lang.Object)
        at org.eclipse.jetty.io.nio.ChannelEndPoint.fill(ChannelEndPoint.java:230)
        - locked <0x00002aaae6d09608> (a java.nio.HeapByteBuffer)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.fill(SelectChannelEndPoint.java:300)
        at org.eclipse.jetty.websocket.WebSocketConnectionD00.handle(WebSocketConnectionD00.java:119)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
        at java.lang.Thread.run(Thread.java:619)

I understand this is not simple to track, so let me know what kind of logging I can share in order to fix the issue. One workaround I have right now is to downgrade to long-polling when I detect this version of the protocol websocket, but I don't like the solution.


Reproducible: Always
Comment 1 Greg Wilkins CLA 2011-12-27 19:43:51 EST
We made some changes to the D00 parser for http://jira.codehaus.org/browse/JETTY-1463 - which improved several aspects of the D00 handling.   Can you try RC2 build?

Failing that, any clue you can give us as to what state these connection are in would be really helpful - ie is the client closed, TIME_WAIT, CLOSE_WAIT??? etc.
Comment 2 Greg Wilkins CLA 2011-12-27 21:36:42 EST
I've improved the D00 test harness with some more close tests and no problems found so far.
Comment 3 Greg Wilkins CLA 2012-01-10 20:27:39 EST
in 7.6 and 8.1