Return-Path: Delivered-To: apmail-commons-issues-archive@locus.apache.org Received: (qmail 67881 invoked from network); 20 Sep 2007 05:26:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Sep 2007 05:26:45 -0000 Received: (qmail 11073 invoked by uid 500); 20 Sep 2007 05:26:29 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 10926 invoked by uid 500); 20 Sep 2007 05:26:28 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 10883 invoked by uid 99); 20 Sep 2007 05:26:28 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Sep 2007 22:26:28 -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; Thu, 20 Sep 2007 05:28:33 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 5308071420B for ; Wed, 19 Sep 2007 22:26:13 -0700 (PDT) Message-ID: <15494003.1190265973335.JavaMail.jira@brutus> Date: Wed, 19 Sep 2007 22:26:13 -0700 (PDT) From: "Henri Yandell (JIRA)" To: issues@commons.apache.org Subject: [jira] Closed: (NET-3) [net][PATCH] TelnetInputStream.read sometimes hangs if reader thread is disabled 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/NET-3?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Henri Yandell closed NET-3. --------------------------- Resolution: Fixed Reclosing so it gets marked as Fixed. Jira migration bug. > [net][PATCH] TelnetInputStream.read sometimes hangs if reader thread is disabled > -------------------------------------------------------------------------------- > > Key: NET-3 > URL: https://issues.apache.org/jira/browse/NET-3 > Project: Commons Net > Issue Type: Bug > Environment: Operating System: Windows XP > Platform: PC > Reporter: Rob Hasselbaum > Attachments: hanging_read_fix.patch > > > I'm trying to use TelnetClient with the reader thread disabled because I don't > want socket timeouts to fire during planned periods of inactivity (COM-1554). > But when the thread is disabled, I'm finding that TelnetInputStream.read > occassionally hangs when I try to read output from the server. > The problem appears to be the first while loop in __processChar, which looks > like this: > synchronized (__queue) > { > while (__bytesAvailable >= __queue.length - 1) > { > if(__threaded) > { > __queue.notify(); > try > { > __queue.wait(); > } > catch (InterruptedException e) > { > throw e; > } > } > ... > } > If you get into this loop and the threaded flag is false, you are stuck > forever. That's what's happening in my case. If I suspend the thread, I can > see that (__bytesAvailable) is 2048 and (__queue.length - > 1) is also 2048, so it's an infinite loop. > I'm not sure what triggers this, but it seems to happen most often when there > is a pause in server output or a pause before I initiate the next read. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.