java/105482: diablo-jdk1.5.0/jdk-1.5.0 java.nio.Selector bug
Kostik Belousov
kostikbel at gmail.com
Mon Nov 13 16:08:42 UTC 2006
>Number: 105482
>Category: java
>Synopsis: diablo-jdk1.5.0/jdk-1.5.0 java.nio.Selector bug
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: freebsd-java
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Mon Nov 13 16:00:15 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator: Kostik Belousov
>Release: RELENG_6
>Organization:
-
>Environment:
FreeBSD deviant.kiev.zoral.com.ua 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE #2: Mon Oct 30 10:37:21 EET 2006 root at deviant.kiev.zoral.com.ua:/usr/obj/usr/src/sys/DEVIANT i386
>Description:
The following is reproducable on both diablo-jdk-1.5.0.07.01_1 and
jdk-1.5.0p3_6 on RELENG_6/i386.
The key added to the java.nio.Selector initally has only SelectionKey.OP_READ
in the interestOps(). Due to some external events, OP_WRITE was added to the
interestOps() and Selector.wakeup() was called. Socket associated with key is
definitely ready to be written, but the next Selector.select() call will sleep
until some data appears to be ready to be read from the socket.
I expect that Selector.select() would return immediately in this situation,
returning specified key with isWritable() == true.
Below is the trace
(SELECTED is printed when the Selector.select() returns;
R XX W XX show the OP_READ|OP_WRITE registration for the channel;
PROCESS is printed when key is active;
IS WRITABLE is printed when key is active and isWritable returned true).
[java] SELECTED
[java] accepted java.nio.channels.SocketChannel[connected local=/127.0.0.1:5090 remote=/127.0.0.1:63157]
[java] UPDATE REG java.nio.channels.SocketChannel[connected local=/127.0.0.1:5090 remote=/127.0.0.1:63157] 1
[java] SENDCMD 12342324
[java] UPDATE REG java.nio.channels.SocketChannel[connected local=/127.0.0.1:5090 remote=/127.0.0.1:63157] 5
[java] SELECTED
[java] SELECTED
[java] PROCESS java.nio.channels.SocketChannel[connected local=/127.0.0.1:5090 remote=/127.0.0.1:63157]5 R true W false
[java] f
[java] UPDATE REG java.nio.channels.SocketChannel[connected local=/127.0.0.1:5090 remote=/127.0.0.1:63157] 5
[java] SELECTED
[java] PROCESS java.nio.channels.SocketChannel[connected local=/127.0.0.1:5090 remote=/127.0.0.1:63157]5 R false W true
[java] PROCESS IS WRITABLE java.nio.channels.SocketChannel[connected local=/127.0.0.1:5090 remote=/127.0.0.1:63157]
[java] UPDATE REG java.nio.channels.SocketChannel[connected local=/127.0.0.1:5090 remote=/127.0.0.1:63157] 1
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-java
mailing list