Uploaded image for project: 'TorqueBox'
  1. TorqueBox
  2. TORQUE-976

Scheduled Tasks with Timeouts Never Clean Up Their Thread Pools

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2.1.2
    • Fix Version/s: 2.2.0
    • Component/s: Jobs
    • Labels:
      None
    • Environment:

      JRuby 1.7.0, JRE 1.6 (appears in Sun 1.6.0_28, OpenJDK 1.6.0_12, and whatever JRE comes on OS X ML)

    • Steps to Reproduce:
      Hide

      Create a scheduled job with a timeout. There's a convenient Rails app I wrote which makes it as easy as a git clone: https://github.com/Necropolis/cloaked-octo-archer

      Show
      Create a scheduled job with a timeout. There's a convenient Rails app I wrote which makes it as easy as a git clone: https://github.com/Necropolis/cloaked-octo-archer
    • Workaround Description:
      Hide

      Don't use the timeouts feature; instead roll your own timeout mechanism, such having your algorithm die after Time.now elapses a certain amount.

      Show
      Don't use the timeouts feature; instead roll your own timeout mechanism, such having your algorithm die after Time.now elapses a certain amount.

      Description

      Suppose you have a scheduled job with a timeout. JBoss Polyglot will fire off a thread pool to enforce the timeout. However, this thread pool is never reclaimed, resulting is some truly large leaks over time. I have a staging server with 1,900+ threads right now - which I think is incredibly funny. It is a staging server, after all. We punish them for fun.

      bbrowning on IRC indicated this line as the culprit:

      https://github.com/projectodd/jboss-polyglot/blob/f5a82960e2443a7701154decec8174f0c43ab281/jobs/src/main/java/org/projectodd/polyglot/jobs/TimeoutListener.java#L43

      Something should probably be done to help these pools clean themselves up when they're done. Perhaps downgrade them to hot-tubs or something. (java.lang.Jaccuzzi?)

      Speaking of torturing staging servers, I think I'm going to load-test mine now.

      Cheers!

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                benbrowning Benjamin Browning
                Reporter:
                nserror Christopher Miller
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: