You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Martin Oberhuber (JIRA)" <ji...@apache.org> on 2007/09/12 14:07:32 UTC
[jira] Commented: (NET-3) [net][PATCH] TelnetInputStream.read
sometimes hangs if reader thread is disabled
[ https://issues.apache.org/jira/browse/NET-3?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12526756 ]
Martin Oberhuber commented on NET-3:
------------------------------------
It looks like this patch has been applied for an "1.4.x" version of Commons Net,
but I cannot find such a released version anywhere.
How can I get a version of Commons Net that's compatible with 1.4.1 but has the patch?
Are there any plans for releasing 1.4.2 or 1.5?
FYI, at Eclipse DSDP-TM (http://www.eclipse.org/dsdp/tm) we're tracking this as
https://bugs.eclipse.org/bugs/show_bug.cgi?id=202758
> [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.