{"action":"created","issue":{"url":"https://api.github.com/repos/wildfly/wildfly/issues/8365","labels_url":"https://api.github.com/repos/wildfly/wildfly/issues/8365/labels{/name}","comments_url":"https://api.github.com/repos/wildfly/wildfly/issues/8365/comments","events_url":"https://api.github.com/repos/wildfly/wildfly/issues/8365/events","html_url":"https://github.com/wildfly/wildfly/pull/8365","id":114527492,"number":8365,"title":"[WFLY-5596] Make MDB delivery activation thread safe.","user":{"login":"doctau","id":704925,"avatar_url":"https://avatars.githubusercontent.com/u/704925?v=3","gravatar_id":"","url":"https://api.github.com/users/doctau","html_url":"https://github.com/doctau","followers_url":"https://api.github.com/users/doctau/followers","following_url":"https://api.github.com/users/doctau/following{/other_user}","gists_url":"https://api.github.com/users/doctau/gists{/gist_id}","starred_url":"https://api.github.com/users/doctau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doctau/subscriptions","organizations_url":"https://api.github.com/users/doctau/orgs","repos_url":"https://api.github.com/users/doctau/repos","events_url":"https://api.github.com/users/doctau/events{/privacy}","received_events_url":"https://api.github.com/users/doctau/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2015-11-02T05:25:31Z","updated_at":"2015-12-09T23:14:21Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/wildfly/wildfly/pulls/8365","html_url":"https://github.com/wildfly/wildfly/pull/8365","diff_url":"https://github.com/wildfly/wildfly/pull/8365.diff","patch_url":"https://github.com/wildfly/wildfly/pull/8365.patch"},"body":"This may not be suitable for merging as-is.\r\n\r\nThe activate() and deactivate() calls invoke user (resource adapter) code, so doing that while inside a synchronized section could potentially be a deadlock risk since the user code way try to take other locks.\r\n\r\n\r\nChecking the 'deliveryActive' flag inside a synchronized block (or using AtomicBoolean) would solve part of the problem, but by itself it would still allow problems where activate()/deactivate() get called in the wrong order if one thread called stopDelivery() concurrently with a startDelivery() or start() call (and vice versa).\r\n\r\nThe activation could be done asychronously but orders, however then the delivery status would not actually have been changed when the call returns, which may cause other problems. I'm not sure what the best course of action is here."},"comment":{"url":"https://api.github.com/repos/wildfly/wildfly/issues/comments/163432715","html_url":"https://github.com/wildfly/wildfly/pull/8365#issuecomment-163432715","issue_url":"https://api.github.com/repos/wildfly/wildfly/issues/8365","id":163432715,"user":{"login":"bmaxwell","id":569491,"avatar_url":"https://avatars.githubusercontent.com/u/569491?v=3","gravatar_id":"","url":"https://api.github.com/users/bmaxwell","html_url":"https://github.com/bmaxwell","followers_url":"https://api.github.com/users/bmaxwell/followers","following_url":"https://api.github.com/users/bmaxwell/following{/other_user}","gists_url":"https://api.github.com/users/bmaxwell/gists{/gist_id}","starred_url":"https://api.github.com/users/bmaxwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmaxwell/subscriptions","organizations_url":"https://api.github.com/users/bmaxwell/orgs","repos_url":"https://api.github.com/users/bmaxwell/repos","events_url":"https://api.github.com/users/bmaxwell/events{/privacy}","received_events_url":"https://api.github.com/users/bmaxwell/received_events","type":"User","site_admin":false},"created_at":"2015-12-09T23:14:21Z","updated_at":"2015-12-09T23:14:21Z","body":"Is this ok to merge? We are looking to include downstream if so."}}