harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jimmy, Jing Lv (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-3631) [classlib][luni][nio] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception
Date Fri, 13 Apr 2007 07:16:15 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-3631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12488598
] 

Jimmy, Jing Lv commented on HARMONY-3631:
-----------------------------------------

Hi,
    I've tried this test (with patch on) on my desktop(Windows XP sp2), on IBMVME, but did
not find that error, the output was:
"Client created
Server created
Non-blocking connection established
Server expectedly unable to send all 104857600 bytes to client
Server closed connection with client"
    RI shows the same result.
    But according to the exception that thrown, the send operation was blocked due to some
OS-level issues. I guess we can catch that exception, return Zero and send again sometime.


PS: for windows, MSDN says:
"This error is returned from operations on nonblocking sockets that cannot be completed immediately,
for example recv when no data is queued to be read from the socket. It is a nonfatal error,
and the operation should be retried later. It is normal for WSAEWOULDBLOCK to be reported
as the result from calling connect on a nonblocking SOCK_STREAM socket, since some time must
elapse for the connection to be established."

> [classlib][luni][nio] Write operation to non-blocking SocketChannel with overfull output
buffer causes unexpected exception
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3631
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3631
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Windows and Linux
>            Reporter: Ivaschenko, Aleksei V
>         Assigned To: Paulex Yang
>         Attachments: luni.patch, NIOTest.java
>
>
> The attached test creatres non-blocking SocketChannel connection and writes into channel
untinl socket output buffer become overfull and further write operations will not write even
one byte. This is normal situation according to SocketChannel spec and no exceptions should
be thrown. But the test fails on Harmony with exception:
> java.lang.NoSuchMethodError: init
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketDirectImpl(Native
Method)
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeDirect(OSNetworkSystem.java:105)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.writeImpl(SocketChannelImpl.java:557)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:491)
>         ...
> This exception is generated by JNI call to GetMethodID while attempt to find java.net.SocketException
constructor by name "init" instead of "<init>".
> This part of the issue could be fixed with attached patch. Even when this is fixed, the
test continue to fail with unexpected exception (but with another one):
> java.net.SocketException: The socket is marked as nonblocking operation would block
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketDirectImpl(Native
Method)
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeDirect(OSNetworkSystem.java:105)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.writeImpl(SocketChannelImpl.java:557)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:491)
>         ...
> It's a reasonable exception for non-blocking connections, but according to spec it shouldn't
be thrown - write method of SocketChannel should return 0 instead.
> This issue also leads Jetty scenario (HARMONY-3530) to fail.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message