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

Scheduled Tasks with Timeouts Never Clean Up Their Thread Pools

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2.1.2
    • Fix Version/s: 2.2.0
    • Component/s: Jobs
    • Labels:
      None
    • 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!

        Attachments

          Activity

            People

            Assignee:
            benbrowning Ben Browning
            Reporter:
            nserror Christopher Miller (Inactive)
            Archiver:
            samahaja Sagar Mahajan

              Dates

              Created:
              Updated:
              Resolved:
              Archived: