Uploaded image for project: 'JBoss Remoting'
  1. JBoss Remoting
  2. JBREM-762

Deadlock bug in socket invoker

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Out of Date
    • 1.4.6.GA
    • None
    • transport
    • None

    Description

      There is a potential thread leak in ServerThread.java that causes ServerThreads to stick around, but to disappear from the thread pool as the accept() thread(s) see it. Eventually, when the # of leaked threads reaches the MaxPoolSize, the system ends up deadlocked and will not accept any more incoming socket connections. I have described the problem in great detail in a forum post and in support case 00016786. I have patched the code, and so far it seems to be working fine and to have fixed the problem. This is what I patched:

      In ServerThread.java, I wrapped the contents of wakeup() inside of a try/catch, block, with the following code in the catch block:

      } catch (Exception e) {
      synchronized (clientpool) {
      synchronized (threadpool)

      { clientpool.remove(this); threadpool.add(this); Thread.interrupted(); }

      }
      throw e;
      }

      This makes sure that the thread is put back into the threadpool when an exception occurs in the createServerSocket() method (this method is doing socket I/O in 1.4.6, and in our case, this socket connection was timing out.).

      Attachments

        Activity

          People

            Unassigned Unassigned
            javajedi_jira Tim McCune (Inactive)
            Archiver:
            samahaja@redhat.com Sagar Mahajan

            Dates

              Created:
              Updated:
              Resolved:
              Archived: