Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8002306

(se) Selector.open fails if invoked with thread interrupt status set [win]

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 8
    • None
    • core-libs
    • None
    • b73
    • windows
    • Verified

    Backports

      Description



        import java.nio.channels.*;

        public class Test {
            public static void main(String... args) throws Exception {
                Thread.currentThread().interrupt();
                Selector.open();
            }
        }


        C:\> java Test
        Exception in thread "main" java.io.IOException: Unable to establish loopback connection
                at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:125)
                at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:69)
                at java.security.AccessController.doPrivileged(Native Method)
                at sun.nio.ch.PipeImpl.<init>(PipeImpl.java:141)
                at sun.nio.ch.SelectorProviderImpl.openPipe(SelectorProviderImpl.java:50)
                at java.nio.channels.Pipe.open(Pipe.java:150)
                at sun.nio.ch.WindowsSelectorImpl.<init>(WindowsSelectorImpl.java:126)
                at sun.nio.ch.WindowsSelectorProvider.openSelector(WindowsSelectorProvider.java:44)
                at java.nio.channels.Selector.open(Selector.java:227)
                at Test.main(Test.java:7)
        Caused by: java.nio.channels.ClosedByInterruptException
                at java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:202)
                at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:634)
                at java.nio.channels.SocketChannel.open(SocketChannel.java:184)
                at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:97)
                ... 9 more


        Attachments

          Issue Links

            Activity

              People

                dxu Dan Xu (Inactive)
                alanb Alan Bateman
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: