{"action":"created","issue":{"url":"https://api.github.com/repos/android-rcs/rcsjta/issues/179","labels_url":"https://api.github.com/repos/android-rcs/rcsjta/issues/179/labels{/name}","comments_url":"https://api.github.com/repos/android-rcs/rcsjta/issues/179/comments","events_url":"https://api.github.com/repos/android-rcs/rcsjta/issues/179/events","html_url":"https://github.com/android-rcs/rcsjta/issues/179","id":122919221,"number":179,"title":"Core : Thread leak","user":{"login":"fgicquel","id":13115544,"avatar_url":"https://avatars.githubusercontent.com/u/13115544?v=3","gravatar_id":"","url":"https://api.github.com/users/fgicquel","html_url":"https://github.com/fgicquel","followers_url":"https://api.github.com/users/fgicquel/followers","following_url":"https://api.github.com/users/fgicquel/following{/other_user}","gists_url":"https://api.github.com/users/fgicquel/gists{/gist_id}","starred_url":"https://api.github.com/users/fgicquel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fgicquel/subscriptions","organizations_url":"https://api.github.com/users/fgicquel/orgs","repos_url":"https://api.github.com/users/fgicquel/repos","events_url":"https://api.github.com/users/fgicquel/events{/privacy}","received_events_url":"https://api.github.com/users/fgicquel/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"MurthyVadapalli","id":13116384,"avatar_url":"https://avatars.githubusercontent.com/u/13116384?v=3","gravatar_id":"","url":"https://api.github.com/users/MurthyVadapalli","html_url":"https://github.com/MurthyVadapalli","followers_url":"https://api.github.com/users/MurthyVadapalli/followers","following_url":"https://api.github.com/users/MurthyVadapalli/following{/other_user}","gists_url":"https://api.github.com/users/MurthyVadapalli/gists{/gist_id}","starred_url":"https://api.github.com/users/MurthyVadapalli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MurthyVadapalli/subscriptions","organizations_url":"https://api.github.com/users/MurthyVadapalli/orgs","repos_url":"https://api.github.com/users/MurthyVadapalli/repos","events_url":"https://api.github.com/users/MurthyVadapalli/events{/privacy}","received_events_url":"https://api.github.com/users/MurthyVadapalli/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-12-18T10:06:38Z","updated_at":"2016-01-22T13:27:28Z","closed_at":"2016-01-22T13:27:28Z","body":"When starting the RCS stack, 'HandlerThread' are created and started upon construction of IMS services (InstantMessagingService, RichcallService, Sip, Https, ...). \r\nAfter stopping the RCS stack, these threads are still running.\r\nStep 1 : take a thread dump of the 'com.gsma.rcs' process  before starting the stack.\r\nStep 2 : start the RCS stack.\r\nStep 3 : stop the RCS stack.\r\nStep 4 : take a new thread dump of the 'com.gsma.rcs' process.\r\nStep 5 : start the RCS stack.\r\nStep 6 : stop the RCS stack.\r\nStep 7 : take a new thread dump of the 'com.gsma.rcs' process.\r\n\r\nExpected result : the number of threads shall be the same in each thread dump.\r\nCurrent result : by comparing the different thread dump, we noticed that the number of threads is increasing.\r\n\r\nYou will find in attachments examples of thread dumps.\r\n[threads_report_initial_state.txt](https://github.com/android-rcs/rcsjta/files/66450/threads_report_initial_state.txt)\r\n[threads_report_after_first_stop.txt](https://github.com/android-rcs/rcsjta/files/66451/threads_report_after_first_stop.txt)\r\n[threads_report._after_second_stop.txt](https://github.com/android-rcs/rcsjta/files/66452/threads_report._after_second_stop.txt)\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/android-rcs/rcsjta/issues/comments/173921733","html_url":"https://github.com/android-rcs/rcsjta/issues/179#issuecomment-173921733","issue_url":"https://api.github.com/repos/android-rcs/rcsjta/issues/179","id":173921733,"user":{"login":"yplo6403","id":13114196,"avatar_url":"https://avatars.githubusercontent.com/u/13114196?v=3","gravatar_id":"","url":"https://api.github.com/users/yplo6403","html_url":"https://github.com/yplo6403","followers_url":"https://api.github.com/users/yplo6403/followers","following_url":"https://api.github.com/users/yplo6403/following{/other_user}","gists_url":"https://api.github.com/users/yplo6403/gists{/gist_id}","starred_url":"https://api.github.com/users/yplo6403/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yplo6403/subscriptions","organizations_url":"https://api.github.com/users/yplo6403/orgs","repos_url":"https://api.github.com/users/yplo6403/repos","events_url":"https://api.github.com/users/yplo6403/events{/privacy}","received_events_url":"https://api.github.com/users/yplo6403/received_events","type":"User","site_admin":false},"created_at":"2016-01-22T13:27:28Z","updated_at":"2016-01-22T13:27:28Z","body":"Bug fixed with commit:\r\ncommit 53fe391a980045f59e1f1c9c7bf82d37fec7bac7\r\nAuthor: yplo6403 <philippe.lemordant@orange.com>\r\nDate:   Fri Jan 22 14:26:03 2016 +0100\r\n\r\n    Core: background handlers only quit operations if stop is due to TERMINATION_BY_SYSTEM\r\n    When ims service stops, OperationHandlers will be set to null in\r\n    currently implementation. This will cause null pointer exception\r\n    when user trying to delete conversations during ims service stopped\r\n    period, for example airplane mode or network loss.\r\n\r\n    This patch fixed the issue by recreate OperationHandlers when ims\r\n    service is stopped.\r\n\r\n    Background operations are only stopped if termination is due to system (i.e. stack deactivation).\r\n    Otherwise background handlers are kept and can be reused when network connection is recovered.\r\n"}}