Uploaded image for project: 'Commons Net'
  1. Commons Net
  2. NET-145

Deadlock in TelnetInputStream

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.4
    • 2.0
    • None
    • None
    • Heavy mutlithreaded environment using Jakarta VFS (which uses Commons Net) for ftp file transfers

    Description

      "Sometimes" single threads of our application (each thread transfering data from ftp servers) get locked forever. When monitoring our tool with JConsole, I can see that such a thread usually hangs at org.apache.commons.net.telnet.TelnetInputStream, line 339.

      This line contains the statement
      __queue.wait();

      Unfortunately I haven't found a way to reproduce this issue, it just happens about once a day (while running 24 hours and transfering about 50000 files).

      As a quick and dirty workaround: What do you think about replacing this line with something like
      long startTime = System.currentTimeMillis();
      __queue.wait(60000);
      if ((System.currentTimeMillis() - startTime) > 55000) {
      throw new InterruptedException("Unknown strange and nasty blocker detected");
      }

      So at least it would not just block the thread.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              snowbird Norbert Seekircher
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: