Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D7165985D for ; Fri, 5 Oct 2012 18:02:03 +0000 (UTC) Received: (qmail 17186 invoked by uid 500); 5 Oct 2012 18:02:03 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 17110 invoked by uid 500); 5 Oct 2012 18:02:03 -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 17098 invoked by uid 99); 5 Oct 2012 18:02:03 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Oct 2012 18:02:03 +0000 Date: Fri, 5 Oct 2012 18:02:03 +0000 (UTC) From: "Sebb (JIRA)" To: issues@commons.apache.org Message-ID: <1134967466.1824.1349460123257.JavaMail.jiratomcat@arcas> In-Reply-To: <1050706288.136.1337866855775.JavaMail.javamailuser@localhost> Subject: [jira] [Resolved] (NET-466) Regression: TelnetInputStream#available() blocks MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/NET-466?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sebb resolved NET-466. ---------------------- Resolution: Fixed > Regression: TelnetInputStream#available() blocks > ------------------------------------------------ > > Key: NET-466 > URL: https://issues.apache.org/jira/browse/NET-466 > Project: Commons Net > Issue Type: Bug > Components: Telnet > Affects Versions: 3.1 > Reporter: Martin Oberhuber > Priority: Critical > Fix For: 3.2 > > > When testing with Commons Net 3.1 for Eclipse https://bugs.eclipse.org/bugs/show_bug.cgi?id=194473 , I found that our telnet client blocks when the ReaderThread is running and waiting for new data. Investigation shows that our code blocks on TelnetInputStream#available(). > This regression is due to the code introduced for NET-437 "TelnetInputStream doesn't support non-blocking IO when reader thread is not enabled": > TelnetInputStream#available() now calls super.available() which is declared as "synchronized" on BufferedInputStream in JDK 1.6.0_21 at least. But at the same time, the telnet ReaderThread has already the Monitor on BufferedInputStream and doesn't give it up while sitting in read0(). > This seems to be exactly the situation that the comment before TelnetInputStream#close() warns about: > // Cannot be synchronized. Will cause deadlock if run() is blocked > // in read because BufferedInputStream read() is synchronized. > This is a severe issue since it violates the specification and use of available(). -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira