Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 17850 invoked from network); 13 Apr 2007 07:46:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Apr 2007 07:46:36 -0000 Received: (qmail 65027 invoked by uid 500); 13 Apr 2007 07:46:42 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 65010 invoked by uid 500); 13 Apr 2007 07:46:42 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 65001 invoked by uid 99); 13 Apr 2007 07:46:42 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Apr 2007 00:46:42 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Apr 2007 00:46:35 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id A1DBD71407D for ; Fri, 13 Apr 2007 00:46:15 -0700 (PDT) Message-ID: <22556319.1176450375660.JavaMail.jira@brutus> Date: Fri, 13 Apr 2007 00:46:15 -0700 (PDT) From: "Jimmy, Jing Lv (JIRA)" To: commits@harmony.apache.org Subject: [jira] Commented: (HARMONY-3631) [classlib][luni][nio] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception In-Reply-To: <7713486.1176360932482.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-3631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12488604 ] Jimmy, Jing Lv commented on HARMONY-3631: ----------------------------------------- Hi, I looked into the SocketChannelImpl.writeImpl(), but find the code has already handle the problem: " ... } catch (SocketException e) { if (e.getCause() instanceof ErrorCodeException) { if (ERRCODE_SOCKET_NONBLOCKING_WOULD_BLOCK == ((ErrorCodeException) e .getCause()).getErrorCode()) { return writeCount; // <--NOTE: This line catch the blocking exception for nonblocking } } throw e; } ..." So I feel surprised the exception was still thrown (on DRLVM, I guess?) Is the error code of such issue changed in Port-Lib? > [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 "". > 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.