jsip
  1. jsip
  2. JSIP-428

When enable thread pool and set gov.nist.javax.sip.THREAD_AUDIT_INTERVAL_IN_MILLISECS, we keep receiving "SIP stack has dead threads (this indicates leaks!)"

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: current
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Symptom
      ========
      After I updated the SIP library, I keep seeing errors:

      2010-12-14 21:28:49,165 [Timer-12] DEBUG - - Trying to audit active calls
      2010-12-14 21:28:59,171 [Timer-12] DEBUG - - SIP stack has dead threads (this indicates leaks!)
      2010-12-14 21:28:59,171 [Timer-12] DEBUG - - Thread Auditor Report:
      Thread [AlarmPoint SIP Clientsip431@192.168.170.68:5064-UDPMessageChannelThread-48] has failed to respond to an audit request.
      Thread [AlarmPoint SIP Clientsip431@192.168.170.68:5064-UDPMessageChannelThread-91] has failed to respond to an audit request.

      Cause
      ========
      In my code, we do
      properties.setProperty("gov.nist.javax.sip.THREAD_AUDIT_INTERVAL_IN_MILLISECS", "10000");

      This enables the auditor in SIP library. The library has mechanism to monitor if the thread is still alive or not. A monitored thread must call threadHandle.ping() to inform the auditor that the thread is still alive in 10 seconds (10000ms is 10 seconds). However, the code in UDPMessageChannel.run(), the threads could be stuck to wait for new packet in a blocking queue. The waiting time is infinite. So if there is no packet in the queue, all threads are stuck there and have no chance to call ping method to inform that the threads are still alive.

      I also notice in the old version (like version 138), the code is correct. And it worked fine.

      Fix:
      ====
      The patch is attached. It combines code in version 138 and current trunk code.

      1. jsip.patch
        2 kB
        ywang4074
      2. jsip5.patch
        2 kB
        ywang4074

        Activity

        Hide
        ywang4074 added a comment -

        For java 1.5

        Show
        ywang4074 added a comment - For java 1.5
        Hide
        mranga added a comment -

        Patch applied in r2135 (thanks)

        Show
        mranga added a comment - Patch applied in r2135 (thanks)
        Hide
        deruelle_jean added a comment -

        This fix introduced a penalty when not using the flag where 25% of the CPU was taken even when idle.

        Commits r2149 and r2150 fixes that problem.

        Show
        deruelle_jean added a comment - This fix introduced a penalty when not using the flag where 25% of the CPU was taken even when idle. Commits r2149 and r2150 fixes that problem.
        Hide
        deruelle_jean added a comment -

        Fix in r2154 as well

        Show
        deruelle_jean added a comment - Fix in r2154 as well

          People

          • Assignee:
            Unassigned
            Reporter:
            ywang4074
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: