{"action":"created","comment":{"url":"https://api.github.com/repos/ccbrown/needy/pulls/comments/58968765","id":58968765,"diff_hunk":"@@ -184,6 +184,11 @@ def main(args=sys.argv):\n \n     lock_fd = os.open('.needy_lock', os.O_RDWR | os.O_CREAT)\n     try:\n+        try:\n+            fcntl.flock(lock_fd, fcntl.LOCK_EX | fcntl.LOCK_NB)\n+        except IOError:\n+            print('Unable to lock .needy_lock, please be sure that only one instance of needy is running')\n+            raise\n         fcntl.flock(lock_fd, fcntl.LOCK_EX)","path":"needy/__main__.py","position":9,"original_position":9,"commit_id":"a35569b78addbddf837d22701b3d2d633b82ed0d","original_commit_id":"a35569b78addbddf837d22701b3d2d633b82ed0d","user":{"login":"vmrob","id":622110,"avatar_url":"https://avatars.githubusercontent.com/u/622110?v=3","gravatar_id":"","url":"https://api.github.com/users/vmrob","html_url":"https://github.com/vmrob","followers_url":"https://api.github.com/users/vmrob/followers","following_url":"https://api.github.com/users/vmrob/following{/other_user}","gists_url":"https://api.github.com/users/vmrob/gists{/gist_id}","starred_url":"https://api.github.com/users/vmrob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmrob/subscriptions","organizations_url":"https://api.github.com/users/vmrob/orgs","repos_url":"https://api.github.com/users/vmrob/repos","events_url":"https://api.github.com/users/vmrob/events{/privacy}","received_events_url":"https://api.github.com/users/vmrob/received_events","type":"User","site_admin":false},"body":"Note the final attempt at obtaining an exclusive lock while blocking.","created_at":"2016-04-08T01:03:50Z","updated_at":"2016-04-08T01:03:50Z","html_url":"https://github.com/ccbrown/needy/pull/33#discussion_r58968765","pull_request_url":"https://api.github.com/repos/ccbrown/needy/pulls/33","_links":{"self":{"href":"https://api.github.com/repos/ccbrown/needy/pulls/comments/58968765"},"html":{"href":"https://github.com/ccbrown/needy/pull/33#discussion_r58968765"},"pull_request":{"href":"https://api.github.com/repos/ccbrown/needy/pulls/33"}}},"pull_request":{"url":"https://api.github.com/repos/ccbrown/needy/pulls/33","id":65550524,"html_url":"https://github.com/ccbrown/needy/pull/33","diff_url":"https://github.com/ccbrown/needy/pull/33.diff","patch_url":"https://github.com/ccbrown/needy/pull/33.patch","issue_url":"https://api.github.com/repos/ccbrown/needy/issues/33","number":33,"state":"open","locked":false,"title":"Add diagnostic message to failed file locking","user":{"login":"vmrob","id":622110,"avatar_url":"https://avatars.githubusercontent.com/u/622110?v=3","gravatar_id":"","url":"https://api.github.com/users/vmrob","html_url":"https://github.com/vmrob","followers_url":"https://api.github.com/users/vmrob/followers","following_url":"https://api.github.com/users/vmrob/following{/other_user}","gists_url":"https://api.github.com/users/vmrob/gists{/gist_id}","starred_url":"https://api.github.com/users/vmrob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmrob/subscriptions","organizations_url":"https://api.github.com/users/vmrob/orgs","repos_url":"https://api.github.com/users/vmrob/repos","events_url":"https://api.github.com/users/vmrob/events{/privacy}","received_events_url":"https://api.github.com/users/vmrob/received_events","type":"User","site_admin":false},"body":"Previously, if the .needy_lock file existed and was locked by another\r\nprocess, Needy would block indefinitely with no error. This patch\r\nadjusts that behavior so that instead of blocking indefinitely, Needy\r\nwill provide an appropriate error message and will terminate early.","created_at":"2016-04-06T23:06:07Z","updated_at":"2016-04-08T01:03:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e65d1673cb7b323ec1516942356f7e6ae7555fd1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ccbrown/needy/pulls/33/commits","review_comments_url":"https://api.github.com/repos/ccbrown/needy/pulls/33/comments","review_comment_url":"https://api.github.com/repos/ccbrown/needy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ccbrown/needy/issues/33/comments","statuses_url":"https://api.github.com/repos/ccbrown/needy/statuses/a35569b78addbddf837d22701b3d2d633b82ed0d","head":{"label":"vmrob:friendly-locking","ref":"friendly-locking","sha":"a35569b78addbddf837d22701b3d2d633b82ed0d","user":{"login":"vmrob","id":622110,"avatar_url":"https://avatars.githubusercontent.com/u/622110?v=3","gravatar_id":"","url":"https://api.github.com/users/vmrob","html_url":"https://github.com/vmrob","followers_url":"https://api.github.com/users/vmrob/followers","following_url":"https://api.github.com/users/vmrob/following{/other_user}","gists_url":"https://api.github.com/users/vmrob/gists{/gist_id}","starred_url":"https://api.github.com/users/vmrob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmrob/subscriptions","organizations_url":"https://api.github.com/users/vmrob/orgs","repos_url":"https://api.github.com/users/vmrob/repos","events_url":"https://api.github.com/users/vmrob/events{/privacy}","received_events_url":"https://api.github.com/users/vmrob/received_events","type":"User","site_admin":false},"repo":{"id":39359329,"name":"needy","full_name":"vmrob/needy","owner":{"login":"vmrob","id":622110,"avatar_url":"https://avatars.githubusercontent.com/u/622110?v=3","gravatar_id":"","url":"https://api.github.com/users/vmrob","html_url":"https://github.com/vmrob","followers_url":"https://api.github.com/users/vmrob/followers","following_url":"https://api.github.com/users/vmrob/following{/other_user}","gists_url":"https://api.github.com/users/vmrob/gists{/gist_id}","starred_url":"https://api.github.com/users/vmrob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmrob/subscriptions","organizations_url":"https://api.github.com/users/vmrob/orgs","repos_url":"https://api.github.com/users/vmrob/repos","events_url":"https://api.github.com/users/vmrob/events{/privacy}","received_events_url":"https://api.github.com/users/vmrob/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vmrob/needy","description":"A c++ library dependency helper.","fork":true,"url":"https://api.github.com/repos/vmrob/needy","forks_url":"https://api.github.com/repos/vmrob/needy/forks","keys_url":"https://api.github.com/repos/vmrob/needy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vmrob/needy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vmrob/needy/teams","hooks_url":"https://api.github.com/repos/vmrob/needy/hooks","issue_events_url":"https://api.github.com/repos/vmrob/needy/issues/events{/number}","events_url":"https://api.github.com/repos/vmrob/needy/events","assignees_url":"https://api.github.com/repos/vmrob/needy/assignees{/user}","branches_url":"https://api.github.com/repos/vmrob/needy/branches{/branch}","tags_url":"https://api.github.com/repos/vmrob/needy/tags","blobs_url":"https://api.github.com/repos/vmrob/needy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vmrob/needy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vmrob/needy/git/refs{/sha}","trees_url":"https://api.github.com/repos/vmrob/needy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vmrob/needy/statuses/{sha}","languages_url":"https://api.github.com/repos/vmrob/needy/languages","stargazers_url":"https://api.github.com/repos/vmrob/needy/stargazers","contributors_url":"https://api.github.com/repos/vmrob/needy/contributors","subscribers_url":"https://api.github.com/repos/vmrob/needy/subscribers","subscription_url":"https://api.github.com/repos/vmrob/needy/subscription","commits_url":"https://api.github.com/repos/vmrob/needy/commits{/sha}","git_commits_url":"https://api.github.com/repos/vmrob/needy/git/commits{/sha}","comments_url":"https://api.github.com/repos/vmrob/needy/comments{/number}","issue_comment_url":"https://api.github.com/repos/vmrob/needy/issues/comments{/number}","contents_url":"https://api.github.com/repos/vmrob/needy/contents/{+path}","compare_url":"https://api.github.com/repos/vmrob/needy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vmrob/needy/merges","archive_url":"https://api.github.com/repos/vmrob/needy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vmrob/needy/downloads","issues_url":"https://api.github.com/repos/vmrob/needy/issues{/number}","pulls_url":"https://api.github.com/repos/vmrob/needy/pulls{/number}","milestones_url":"https://api.github.com/repos/vmrob/needy/milestones{/number}","notifications_url":"https://api.github.com/repos/vmrob/needy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vmrob/needy/labels{/name}","releases_url":"https://api.github.com/repos/vmrob/needy/releases{/id}","deployments_url":"https://api.github.com/repos/vmrob/needy/deployments","created_at":"2015-07-20T02:45:42Z","updated_at":"2016-03-02T23:08:06Z","pushed_at":"2016-04-08T01:03:07Z","git_url":"git://github.com/vmrob/needy.git","ssh_url":"git@github.com:vmrob/needy.git","clone_url":"https://github.com/vmrob/needy.git","svn_url":"https://github.com/vmrob/needy","homepage":null,"size":202,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ccbrown:master","ref":"master","sha":"637e5d9929668a592f1768bac0950cf6c65855df","user":{"login":"ccbrown","id":1731074,"avatar_url":"https://avatars.githubusercontent.com/u/1731074?v=3","gravatar_id":"","url":"https://api.github.com/users/ccbrown","html_url":"https://github.com/ccbrown","followers_url":"https://api.github.com/users/ccbrown/followers","following_url":"https://api.github.com/users/ccbrown/following{/other_user}","gists_url":"https://api.github.com/users/ccbrown/gists{/gist_id}","starred_url":"https://api.github.com/users/ccbrown/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ccbrown/subscriptions","organizations_url":"https://api.github.com/users/ccbrown/orgs","repos_url":"https://api.github.com/users/ccbrown/repos","events_url":"https://api.github.com/users/ccbrown/events{/privacy}","received_events_url":"https://api.github.com/users/ccbrown/received_events","type":"User","site_admin":false},"repo":{"id":36656387,"name":"needy","full_name":"ccbrown/needy","owner":{"login":"ccbrown","id":1731074,"avatar_url":"https://avatars.githubusercontent.com/u/1731074?v=3","gravatar_id":"","url":"https://api.github.com/users/ccbrown","html_url":"https://github.com/ccbrown","followers_url":"https://api.github.com/users/ccbrown/followers","following_url":"https://api.github.com/users/ccbrown/following{/other_user}","gists_url":"https://api.github.com/users/ccbrown/gists{/gist_id}","starred_url":"https://api.github.com/users/ccbrown/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ccbrown/subscriptions","organizations_url":"https://api.github.com/users/ccbrown/orgs","repos_url":"https://api.github.com/users/ccbrown/repos","events_url":"https://api.github.com/users/ccbrown/events{/privacy}","received_events_url":"https://api.github.com/users/ccbrown/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ccbrown/needy","description":"A c++ library dependency helper.","fork":false,"url":"https://api.github.com/repos/ccbrown/needy","forks_url":"https://api.github.com/repos/ccbrown/needy/forks","keys_url":"https://api.github.com/repos/ccbrown/needy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ccbrown/needy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ccbrown/needy/teams","hooks_url":"https://api.github.com/repos/ccbrown/needy/hooks","issue_events_url":"https://api.github.com/repos/ccbrown/needy/issues/events{/number}","events_url":"https://api.github.com/repos/ccbrown/needy/events","assignees_url":"https://api.github.com/repos/ccbrown/needy/assignees{/user}","branches_url":"https://api.github.com/repos/ccbrown/needy/branches{/branch}","tags_url":"https://api.github.com/repos/ccbrown/needy/tags","blobs_url":"https://api.github.com/repos/ccbrown/needy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ccbrown/needy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ccbrown/needy/git/refs{/sha}","trees_url":"https://api.github.com/repos/ccbrown/needy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ccbrown/needy/statuses/{sha}","languages_url":"https://api.github.com/repos/ccbrown/needy/languages","stargazers_url":"https://api.github.com/repos/ccbrown/needy/stargazers","contributors_url":"https://api.github.com/repos/ccbrown/needy/contributors","subscribers_url":"https://api.github.com/repos/ccbrown/needy/subscribers","subscription_url":"https://api.github.com/repos/ccbrown/needy/subscription","commits_url":"https://api.github.com/repos/ccbrown/needy/commits{/sha}","git_commits_url":"https://api.github.com/repos/ccbrown/needy/git/commits{/sha}","comments_url":"https://api.github.com/repos/ccbrown/needy/comments{/number}","issue_comment_url":"https://api.github.com/repos/ccbrown/needy/issues/comments{/number}","contents_url":"https://api.github.com/repos/ccbrown/needy/contents/{+path}","compare_url":"https://api.github.com/repos/ccbrown/needy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ccbrown/needy/merges","archive_url":"https://api.github.com/repos/ccbrown/needy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ccbrown/needy/downloads","issues_url":"https://api.github.com/repos/ccbrown/needy/issues{/number}","pulls_url":"https://api.github.com/repos/ccbrown/needy/pulls{/number}","milestones_url":"https://api.github.com/repos/ccbrown/needy/milestones{/number}","notifications_url":"https://api.github.com/repos/ccbrown/needy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ccbrown/needy/labels{/name}","releases_url":"https://api.github.com/repos/ccbrown/needy/releases{/id}","deployments_url":"https://api.github.com/repos/ccbrown/needy/deployments","created_at":"2015-06-01T11:26:57Z","updated_at":"2016-03-31T05:51:26Z","pushed_at":"2016-04-08T01:03:07Z","git_url":"git://github.com/ccbrown/needy.git","ssh_url":"git@github.com:ccbrown/needy.git","clone_url":"https://github.com/ccbrown/needy.git","svn_url":"https://github.com/ccbrown/needy","homepage":null,"size":210,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ccbrown/needy/pulls/33"},"html":{"href":"https://github.com/ccbrown/needy/pull/33"},"issue":{"href":"https://api.github.com/repos/ccbrown/needy/issues/33"},"comments":{"href":"https://api.github.com/repos/ccbrown/needy/issues/33/comments"},"review_comments":{"href":"https://api.github.com/repos/ccbrown/needy/pulls/33/comments"},"review_comment":{"href":"https://api.github.com/repos/ccbrown/needy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ccbrown/needy/pulls/33/commits"},"statuses":{"href":"https://api.github.com/repos/ccbrown/needy/statuses/a35569b78addbddf837d22701b3d2d633b82ed0d"}}}}