Bug 1103596 - WebSocket using NIO2 doesn't properly close connections after certain errors
Summary: WebSocket using NIO2 doesn't properly close connections after certain errors
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Web
Version: 6.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ER6
: EAP 6.3.0
Assignee: Rémy Maucherat
QA Contact: Radim Hatlapatka
Russell Dickenson
URL:
Whiteboard:
Depends On: 1104206
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-02 07:38 UTC by Radim Hatlapatka
Modified: 2014-06-28 15:31 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-28 15:31:55 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
jstack of EAP (135.11 KB, text/plain)
2014-06-02 07:38 UTC, Radim Hatlapatka
no flags Details
The server errors (50.48 KB, text/x-log)
2014-06-02 07:40 UTC, Radim Hatlapatka
no flags Details
simple websocket endpoint (8.59 KB, application/x-webarchive)
2014-06-02 07:42 UTC, Radim Hatlapatka
no flags Details
full server log with debug enabled for websockets and connectors (237.74 KB, text/x-log)
2014-06-02 07:43 UTC, Radim Hatlapatka
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1100486 0 unspecified CLOSED Web Socket close does not close underlying connection 2021-02-22 00:41:40 UTC

Internal Links: 1100486

Description Radim Hatlapatka 2014-06-02 07:38:17 UTC
Created attachment 901366 [details]
jstack of EAP

Description of problem:
WebSocket: On server can some connection remain open consuming CPU load even though client part already finished. I am attaching thread dump of EAP server (This could be related to BZ#1100486, but I am running it with JBossWeb 7.4.4.Final which contains the fix).


Version-Release number of selected component (if applicable):
EAP 6.3.0.ER5 also with updated JBossWeb to 7.4.4.Final


How reproducible: mostly


Steps to Reproduce:
1. enable NIO2 connector (requires JAVA 1.7)
2. deploy app with some websocket endpoint (I am attaching one you can use)
3. do websocket operations resulting in the errors visible in attached logs (for me the easiest is to run autobahn testsuite)
4. check CPU load and running threads

Actual results:
Connections remain open with state waiting for condition (see jstack in attachment)


Expected results:
Connections are properly closed

Additional info:
when I am using APR connector instead of NIO2 it works as expected.

Comment 1 Radim Hatlapatka 2014-06-02 07:40:25 UTC
Created attachment 901368 [details]
The server errors

Server errors, you can see matching connection names between the stacktraces and thread dump.

Comment 2 Radim Hatlapatka 2014-06-02 07:42:22 UTC
Created attachment 901369 [details]
simple websocket endpoint

Simple websocket endpoint which just echos the received message plus logs websocket onError messages.

Comment 3 Radim Hatlapatka 2014-06-02 07:43:20 UTC
Created attachment 901370 [details]
full server log with debug enabled for websockets and connectors

Comment 5 Radim Hatlapatka 2014-06-02 09:30:47 UTC
Note: The number of threads managing opened connections and CPU load increases after the execution finished, the client is no longer running.

Comment 6 Rémy Maucherat 2014-06-02 16:04:26 UTC
Avoiding the loop seems possible (r2435), but the main problem is not fixed.

Comment 9 Radim Hatlapatka 2014-06-10 07:14:15 UTC
I am no longer seeing this error with EAP 6.3.0.ER7, verified.


Note You need to log in before you can comment on or make changes to this bug.