JDK-8051403 : (aio) AsynchronousChannelGroup.withXXXThreadPool uses wrong ThreadFactory
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 8u5
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • Submitted: 2014-07-19
  • Updated: 2025-12-11
  • Resolved: 2025-12-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdResolved
Related Reports
Relates :  
Description
When running with a security manager, AsynchronousChannelGroup.withThreadPool and withCachedThreadPool create the channel group with a thread factory that uses InnocuousThread.

For some background, see https://issues.apache.org/jira/browse/SSHD-332
Comments
The ThreadFactory used by AsymnchronousChannelGroup creates InnocuousThreads. The test java/nio/channels/AsynchronousChannelGroup/AsExecutor.java looks like it provides sufficient coverage. Closing as a non-issue.
11-12-2025

Yes, we should just check that the implementation is using the right ThreadFactory, and that we have tests for it. If all good then I think this issue can be closed.
09-12-2025

Given that the security manager is permanently disabled, is this issue relevant any more or can it be closed?
08-12-2025

I see essentially the same exception from the test case with Policy.setPolicy() and System.setSecurityManager() commented out as with them not commented out. Not commented out: Exception in thread "InnocuousThread-1" java.nio.channels.ShutdownChannelGroupException at sun.nio.ch.Invoker.invokeIndirectly(java.base/Invoker.java:223) at sun.nio.ch.Invoker.invoke(java.base/Invoker.java:189) at sun.nio.ch.UnixAsynchronousServerSocketChannelImpl.onEvent(java.base/UnixAsynchronousServerSocketChannelImpl.java:193) at sun.nio.ch.KQueuePort$EventHandlerTask.run(java.base/KQueuePort.java:301) at java.lang.Thread.run(java.base/Thread.java:843) at jdk.internal.misc.InnocuousThread.run(java.base/InnocuousThread.java:122) Commented out: Exception in thread "Thread-0" java.nio.channels.ShutdownChannelGroupException at sun.nio.ch.Invoker.invokeIndirectly(java.base/Invoker.java:223) at sun.nio.ch.Invoker.invoke(java.base/Invoker.java:189) at sun.nio.ch.UnixAsynchronousServerSocketChannelImpl.onEvent(java.base/UnixAsynchronousServerSocketChannelImpl.java:193) at sun.nio.ch.KQueuePort$EventHandlerTask.run(java.base/KQueuePort.java:301) at java.lang.Thread.run(java.base/Thread.java:843)
09-08-2016

We need to fix this in 9 and then back-door it to 8uX and 7uX later.
19-07-2014