-
Notifications
You must be signed in to change notification settings - Fork 124
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
[MgcpDriver] transactionHandlerTimer not cancelled on Driver shutdown #669
Comments
Hi @skywalker788 , agree with your comments. It's not the TransactionHandler responsibility to stop a shared Timer. I think it would also be better to replace that Timer with a ScheduledExecutorService, which is more versatile and can help us reuse a thread pool.
Agree, but not sure if it is necessary for the Timer to be exposed statically... it's ugly. Thanks for taking ownership of this one as well :) Cheers,
|
Hi @hrosa, I am just investigating on the "symptoms" because unluckly I've not the time to study the entire project design. The solution I propose was in my opinion the one with less impact on the project. If all the transaction handlers are managed by JainMgcpStackImpl your suggestion is on the right way. I will work on this asap. Thanks for the fast fb GS |
Hey @skywalker788, Wondering if you found some time to work on this one in the end? |
@gsalis Too busy in the last months... I hope in the next days |
@skywalker788 i know exactly what you mean... :/ Plz feel free to ping me or @hrosa if you need any help on this. ; ) |
Hello everyone,
I'm using the MGCP Driver in my SipServlet project.
Symilar to what happens with the issue #627 we recently close, I found another Thread that does not terminate on Driver shutdown.
It is the transactionHandlerTimer that is allocated as static member by the abstract class TransactionHandler.
As you can verify this Timer is shared between all the TransactionHandler implementations and it is not cancelled on Driver shutdown so it never ends. This is very likely to create a memory leak if the operation is repeated several times (e.g. creating and destroying driver for some reason. In my scenario it happens when I perform an hot deploy of my SipServlet Application in the SipServlet container).
I could propose two solutions:
The naive solution is to create a method in the transaction Handler to cancel the timer and invoke it on the Driver shutdown from JainMgcpStackProviderImpl class. I think that it is not an elegant solution because it is not a provider responsability to cancel a timer allocated somewhere else in the code.
Probably it would be better that is the provider to allocate in a static way this Timer and cancel it on shutdown.
Tell me what you think. I can collaborate on this with a PR.
GS
The text was updated successfully, but these errors were encountered: