Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EventScanner hands infinitely on stack shutdown #198

Open
RomanValov opened this issue Apr 15, 2023 · 0 comments
Open

EventScanner hands infinitely on stack shutdown #198

RomanValov opened this issue Apr 15, 2023 · 0 comments

Comments

@RomanValov
Copy link

Hi

please consider following minimal code example:

import javax.sip.*;

class Test implements SipListener {

    public static void main(String[] args) {
        try {
            SipFactory sipFactory = SipFactory.getInstance();
            sipFactory.setPathName("gov.nist");
            java.util.Properties properties = new java.util.Properties();
            properties.setProperty("javax.sip.STACK_NAME", "test");

            SipStack sipStack = sipFactory.createSipStack(properties);
            sipStack.stop();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

    @Override
    public void processRequest(RequestEvent requestEvent) {
    }

    @Override
    public void processResponse(ResponseEvent responseEvent) {
    }

    @Override
    public void processTimeout(javax.sip.TimeoutEvent timeoutEvent) {
    }

    @Override
    public void processIOException(IOExceptionEvent exceptionEvent) {
    }

    @Override
    public void processTransactionTerminated(
            TransactionTerminatedEvent transactionTerminatedEvent) {
    }

    @Override
    public void processDialogTerminated(
            DialogTerminatedEvent dialogTerminatedEvent) {
    }
}

When executed this code hands forever. Thread dump shows that EventScanner thread is stuck:

"EventScannerThread" #11 prio=5 os_prio=0 cpu=0.82ms elapsed=2.13s tid=0x00007fc04c3e4000 nid=0x17 waiting on condition  [0x00007fc025efd000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park([email protected]/Native Method)
	- parking to wait for  <0x00000000b64cb608> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.park([email protected]/LockSupport.java:194)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await([email protected]/AbstractQueuedSynchronizer.java:2081)
	at java.util.concurrent.LinkedBlockingQueue.take([email protected]/LinkedBlockingQueue.java:433)
	at gov.nist.javax.sip.EventScanner.run(EventScanner.java:512)
	at java.lang.Thread.run([email protected]/Thread.java:829)

Registering listener and listening points doesn't affect the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant