Bug 1090291

Summary: java.nio.channels.ShutdownChannelGroupException during shutdown on Windows
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Petr Kremensky <pkremens>
Component: WebAssignee: Rémy Maucherat <rmaucher>
Status: CLOSED WONTFIX QA Contact: Radim Hatlapatka <rhatlapa>
Severity: urgent Docs Contact: Russell Dickenson <rdickens>
Priority: unspecified    
Version: 6.3.0CC: bbaranow, cdewolf, dandread, kkhan, lcosti, mvelas, rsvoboda
Target Milestone: ---   
Target Release: EAP 6.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-01-27 11:43:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Petr Kremensky 2014-04-23 05:39:27 UTC
Description of problem:
We use following piece of code in acceptance tests to decide, whether server is listening on localhost:8080 during startup.

URL testUrl2 = new URL("http://localhost:8080")
testUrl.getText()

using this method I get an error message during server stop. I was able to reproduce manually (see steps to reproduce).

Version-Release number of selected component (if applicable):
 EAP 6.3.0.ER2

How reproducible:
 Always on Windows with JDK 1.7+

Steps to Reproduce:
 1. start a standalone server (wait until the server is fully booted)
 2. open browser on localhost:8080
 3. reload a server via CLI
  >jboss-cli.bat -c reload
 4. reload a browser panel (use Ctrl+R)
 5. stop a server via CLI and observe server console output
  >jboss-cli.bat -c shutdown

Actual results:
 Error messages in log
 14:08:01,560 ERROR [stderr] (Thread-58) Exception in thread "Thread-58" java.nio.channels.ShutdownChannelGroupException
 14:08:01,607 ERROR [stderr] (Thread-58) 	at sun.nio.ch.Invoker.invokeIndirectly(Invoker.java:210)
 14:08:01,607 ERROR [stderr] (Thread-58) 	at sun.nio.ch.Invoker.invoke(Invoker.java:176)
 14:08:01,607 ERROR [stderr] (Thread-58) 	at sun.nio.ch.Invoker.invoke(Invoker.java:285)
 14:08:01,607 ERROR [stderr] (Thread-58) 	at sun.nio.ch.WindowsAsynchronousSocketChannelImpl$ReadTask.failed(WindowsAsynchronousSocketChannelImpl.java:600)
 14:08:01,607 ERROR [stderr] (Thread-58) 	at sun.nio.ch.Iocp$EventHandlerTask.run(Iocp.java:399)
 14:08:01,607 ERROR [stderr] (Thread-58) 	at java.lang.Thread.run(Thread.java:744)

Expected results:
 No Error logs on server stop

Additional info:
 Regression against EAP 6.2.0.GA

Comment 1 Radim Hatlapatka 2014-04-23 06:30:17 UTC
This is related to BZ#1075695, see mainly https://bugzilla.redhat.com/show_bug.cgi?id=1075695#c15 and following discussion.

Comment 2 Rémy Maucherat 2014-04-23 07:10:29 UTC
It is a known JVM issue on Windows, and cannot be fixed.

I already mentioned it here: https://bugzilla.redhat.com/show_bug.cgi?id=1075695#c15

Comment 3 Radim Hatlapatka 2014-04-23 07:25:46 UTC
There is requirement for clean start and stop of the server (having no errors). Thereby this is definitely a blocker for GA and needs to be addressed.

One of my suggestions are dropping default usage of NIO2 and use JIO which doesn't have this issue. Or if the errors are harmless manage them and just use proper logging level.

Comment 5 Rémy Maucherat 2014-04-23 07:35:18 UTC
As I just said, it is a JVM issue specific to Windows, and I cannot fix it, this cannot be caught or its "logging" level changed.
https://bugs.openjdk.java.net/browse/JDK-7056546

So feel free to change the default connector if needed, it is not an issue for me. The prod build is a good area to do that change.

Comment 6 Petr Kremensky 2014-04-23 09:03:43 UTC
According to Rémy's comment changing the default connector is an option to fix this.

Simple case where customer can hit this: start server / deploy some application / go to application's index page / stop the server.

Comment 7 Rémy Maucherat 2014-04-23 09:22:23 UTC
Yes, but the consequences have to be understood: less scalability, no websockets.

This stack trace can occur on shutdown or more generally when stopping the connector.

Comment 11 Rostislav Svoboda 2014-05-21 12:29:51 UTC
QE: +1

Comment 12 Martin Velas 2014-07-31 12:58:55 UTC
This issue persists in latest EAP 6.3.0.ER10 bits.

Comment 13 Dimitris Andreadis 2014-11-05 16:55:34 UTC
Looking at the history of this, it was agreed this is a JDK issue and won't be fixed. Why it re-surfaced?