Azure / azure-service-bus-java

☁️ Java client library for Azure Service Bus
https://azure.microsoft.com/services/service-bus
MIT License
60 stars 59 forks source link

Fixing high CPU and memory leak in session pump #382

Closed yvgopal closed 5 years ago

yvgopal commented 5 years ago

Session pump keeps trying to accept sessions and if a session is not available on the service, link creation will timeout. CoreMessageReceiver object is created, and then discarded as link creation fails. But the scheduled timer objects that are created in the constructor are not cancelled and after some time, there will too many timers taking CPU cycles and holding reference to CoreMessageRecevier objects preventing them from being garbage collected.