{"action":"created","issue":{"url":"https://api.github.com/repos/zerocracy/farm/issues/1108","repository_url":"https://api.github.com/repos/zerocracy/farm","labels_url":"https://api.github.com/repos/zerocracy/farm/issues/1108/labels{/name}","comments_url":"https://api.github.com/repos/zerocracy/farm/issues/1108/comments","events_url":"https://api.github.com/repos/zerocracy/farm/issues/1108/events","html_url":"https://github.com/zerocracy/farm/pull/1108","id":330301748,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzMzQ0MTQ3","number":1108,"title":"#721 Fixed unlock bug in Terminator","user":{"login":"carlosmiranda","id":1917892,"node_id":"MDQ6VXNlcjE5MTc4OTI=","avatar_url":"https://avatars0.githubusercontent.com/u/1917892?v=4","gravatar_id":"","url":"https://api.github.com/users/carlosmiranda","html_url":"https://github.com/carlosmiranda","followers_url":"https://api.github.com/users/carlosmiranda/followers","following_url":"https://api.github.com/users/carlosmiranda/following{/other_user}","gists_url":"https://api.github.com/users/carlosmiranda/gists{/gist_id}","starred_url":"https://api.github.com/users/carlosmiranda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlosmiranda/subscriptions","organizations_url":"https://api.github.com/users/carlosmiranda/orgs","repos_url":"https://api.github.com/users/carlosmiranda/repos","events_url":"https://api.github.com/users/carlosmiranda/events{/privacy}","received_events_url":"https://api.github.com/users/carlosmiranda/received_events","type":"User","site_admin":false},"labels":[{"id":817441668,"node_id":"MDU6TGFiZWw4MTc0NDE2Njg=","url":"https://api.github.com/repos/zerocracy/farm/labels/scope","name":"scope","color":"3a6622","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2018-06-07T14:36:22Z","updated_at":"2018-06-18T08:08:17Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/zerocracy/farm/pulls/1108","html_url":"https://github.com/zerocracy/farm/pull/1108","diff_url":"https://github.com/zerocracy/farm/pull/1108.diff","patch_url":"https://github.com/zerocracy/farm/pull/1108.patch"},"body":"#721:\r\n\r\nVery subtle bug here. The `Terminator` class checks if lock resources have been freed up by trying it acquire the lock itself. In case resources are not freed up within the timeout, it will log a warning and resubmit the task.\r\n\r\nThe problem is that regardless of whether the lock has been acquired (indicating that resource has been freed) or not, it releases the lock. When this happens it will throw `IllegalMonitorStateException`. This has been fixed by making the unlock conditional to the `Terminator` thread actually managing to acquire the lock. I added a test to verify this as well.\r\n\r\nNote that I flipped the if-condition because PMD was complaining about it being confusing. Which to be honest also confused me at first. :)"},"comment":{"url":"https://api.github.com/repos/zerocracy/farm/issues/comments/397974441","html_url":"https://github.com/zerocracy/farm/pull/1108#issuecomment-397974441","issue_url":"https://api.github.com/repos/zerocracy/farm/issues/1108","id":397974441,"node_id":"MDEyOklzc3VlQ29tbWVudDM5Nzk3NDQ0MQ==","user":{"login":"g4s8","id":1524988,"node_id":"MDQ6VXNlcjE1MjQ5ODg=","avatar_url":"https://avatars0.githubusercontent.com/u/1524988?v=4","gravatar_id":"","url":"https://api.github.com/users/g4s8","html_url":"https://github.com/g4s8","followers_url":"https://api.github.com/users/g4s8/followers","following_url":"https://api.github.com/users/g4s8/following{/other_user}","gists_url":"https://api.github.com/users/g4s8/gists{/gist_id}","starred_url":"https://api.github.com/users/g4s8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/g4s8/subscriptions","organizations_url":"https://api.github.com/users/g4s8/orgs","repos_url":"https://api.github.com/users/g4s8/repos","events_url":"https://api.github.com/users/g4s8/events{/privacy}","received_events_url":"https://api.github.com/users/g4s8/received_events","type":"User","site_admin":false},"created_at":"2018-06-18T08:08:17Z","updated_at":"2018-06-18T08:08:17Z","author_association":"COLLABORATOR","body":"@0crat status"}}
{"actor":{"display_login":"g4s8"}}