executor service never gets cleaned up #431
Labels
difficulty: medium
fix is medium in difficulty
status: help wanted
requesting help from the community
type: community enhancement
feature request not on Twilio's roadmap
Version:
7.22.0
Code Snippet
Steps to Reproduce
The JVM doesn't shut down because there is a thread left hanging around in the executor service.
I would recommend the following:
Add a new field:
Modify setExecutorService:
Modify getExecutorService, adding the line right after the creation and assignment of the executor service and after applying multi-threading fixes as described in #430.
Add a destroy method:
Add a shutdown hook:
Finally, document that it is recommended to call Twilio.destroy before JVM shutdown. However, the shutdown hook will take care of it as a fallback.
The text was updated successfully, but these errors were encountered: