{"action":"opened","issue":{"url":"https://api.github.com/repos/openlvc/portico/issues/118","labels_url":"https://api.github.com/repos/openlvc/portico/issues/118/labels{/name}","comments_url":"https://api.github.com/repos/openlvc/portico/issues/118/comments","events_url":"https://api.github.com/repos/openlvc/portico/issues/118/events","html_url":"https://github.com/openlvc/portico/issues/118","id":54892535,"number":118,"title":"Federates will hang on exit when using 1516e w/ immediate callbacks enabled","user":{"login":"timpokorny","id":912209,"avatar_url":"https://avatars.githubusercontent.com/u/912209?v=3","gravatar_id":"","url":"https://api.github.com/users/timpokorny","html_url":"https://github.com/timpokorny","followers_url":"https://api.github.com/users/timpokorny/followers","following_url":"https://api.github.com/users/timpokorny/following{/other_user}","gists_url":"https://api.github.com/users/timpokorny/gists{/gist_id}","starred_url":"https://api.github.com/users/timpokorny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timpokorny/subscriptions","organizations_url":"https://api.github.com/users/timpokorny/orgs","repos_url":"https://api.github.com/users/timpokorny/repos","events_url":"https://api.github.com/users/timpokorny/events{/privacy}","received_events_url":"https://api.github.com/users/timpokorny/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/openlvc/portico/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/openlvc/portico/labels/in+progress","name":"in progress","color":"ffff00"},{"url":"https://api.github.com/repos/openlvc/portico/labels/urg%3Ahigh","name":"urg:high","color":"ca1a1e"}],"state":"open","locked":false,"assignee":{"login":"timpokorny","id":912209,"avatar_url":"https://avatars.githubusercontent.com/u/912209?v=3","gravatar_id":"","url":"https://api.github.com/users/timpokorny","html_url":"https://github.com/timpokorny","followers_url":"https://api.github.com/users/timpokorny/followers","following_url":"https://api.github.com/users/timpokorny/following{/other_user}","gists_url":"https://api.github.com/users/timpokorny/gists{/gist_id}","starred_url":"https://api.github.com/users/timpokorny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timpokorny/subscriptions","organizations_url":"https://api.github.com/users/timpokorny/orgs","repos_url":"https://api.github.com/users/timpokorny/repos","events_url":"https://api.github.com/users/timpokorny/events{/privacy}","received_events_url":"https://api.github.com/users/timpokorny/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/openlvc/portico/milestones/1","labels_url":"https://api.github.com/repos/openlvc/portico/milestones/1/labels","id":920985,"number":1,"title":"portico-2.1","description":null,"creator":{"login":"timpokorny","id":912209,"avatar_url":"https://avatars.githubusercontent.com/u/912209?v=3","gravatar_id":"","url":"https://api.github.com/users/timpokorny","html_url":"https://github.com/timpokorny","followers_url":"https://api.github.com/users/timpokorny/followers","following_url":"https://api.github.com/users/timpokorny/following{/other_user}","gists_url":"https://api.github.com/users/timpokorny/gists{/gist_id}","starred_url":"https://api.github.com/users/timpokorny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timpokorny/subscriptions","organizations_url":"https://api.github.com/users/timpokorny/orgs","repos_url":"https://api.github.com/users/timpokorny/repos","events_url":"https://api.github.com/users/timpokorny/events{/privacy}","received_events_url":"https://api.github.com/users/timpokorny/received_events","type":"User","site_admin":false},"open_issues":16,"closed_issues":6,"state":"open","created_at":"2015-01-04T12:40:08Z","updated_at":"2015-01-20T14:57:55Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2015-01-20T14:57:55Z","updated_at":"2015-01-20T14:57:55Z","closed_at":null,"body":"Summary\r\n----\r\nFederates will hang when their main thread finishes if they are using the `HLAImmediate` callback model. This is because the immediate callback processing thread remains open, waiting for messages, even after they resign.\r\n\r\nThere are two problems contributing to this:\r\n\r\n * `RTIambassador.disconnect()` doesn't kill the callback thread as it should\r\n * `ImmediateCallbackDispatcher` class doesn't set itself as a daemon thread\r\n\r\nSetting the dispatcher to a daemon thread would \"fix\" the problem, but it's not a proper fix. The `disconnect()` rtiamb call should shut the thread down properly. Putting both fixes in place will give us a real solution, and also protect against people who forget to call disconnect after resigning (I don't know who on earth would do that... oops - me and a thousand others).\r\n\r\nh3. Environment and Logs\r\n----\r\n * Portico `2.0.1`\r\n * `ieee1516e` interface\r\n * Java/C++, 32/64bit, Any OS\r\n \r\nh3.  Reproduction Steps\r\n----\r\n # Create federate that connects to the RTI and joins a federation\r\n # Resign from the federation and disconnect from the RTI\r\n # Let the main thread finish naturally (no `System.exit()` trickery) and note that the process remains alive"}}