{"action":"created","comment":{"url":"https://api.github.com/repos/buildbot/buildbot/pulls/comments/60534293","id":60534293,"diff_hunk":"@@ -542,30 +529,38 @@ def buildFinished(self, text, results):\n         If 'results' is SUCCESS or WARNINGS, we will permit any dependant\n         builds to start. If it is 'FAILURE', those builds will be\n         abandoned.\"\"\"\n-        self.stopBuildConsumer.stopConsuming()\n-        self.finished = True\n-        if self.conn:\n-            self.subs.unsubscribe()\n-            self.subs = None\n-            self.conn = None\n-        log.msg(\" %s: build finished\" % self)\n-        self.results = worst_status(self.results, results)\n-        self.build_status.setText(text)\n-        self.build_status.setResults(self.results)\n-        self.build_status.buildFinished()\n-        eventually(self.releaseLocks)\n-        self.deferred.callback(self)\n-        self.deferred = None\n+        try:\n+            self.stopBuildConsumer.stopConsuming()\n+            self.finished = True\n+            if self.conn:\n+                self.subs.unsubscribe()\n+                self.subs = None\n+                self.conn = None\n+            log.msg(\" %s: build finished\" % self)\n+            self.results = worst_status(self.results, results)\n+            self.build_status.setText(text)\n+            self.build_status.setResults(self.results)\n+            self.build_status.buildFinished()\n+            eventually(self.releaseLocks)\n+            metrics.MetricCountEvent.log('active_builds', -1)\n+\n+            yield self.master.data.updates.setBuildStateString(self.buildid,\n+                                                               u'finished')\n+            yield self.master.data.updates.finishBuild(self.buildid, self.results)\n+\n+            # mark the build as finished\n+            self.workerforbuilder.buildFinished()\n+            self.builder.buildFinished(self, self.workerforbuilder)\n+        except Exception:","path":"master/buildbot/process/build.py","position":93,"original_position":93,"commit_id":"44bf1016d5f169e1d5f3b48f1473789631da7b59","original_commit_id":"44bf1016d5f169e1d5f3b48f1473789631da7b59","user":{"login":"tomprince","id":283816,"avatar_url":"https://avatars.githubusercontent.com/u/283816?v=3","gravatar_id":"","url":"https://api.github.com/users/tomprince","html_url":"https://github.com/tomprince","followers_url":"https://api.github.com/users/tomprince/followers","following_url":"https://api.github.com/users/tomprince/following{/other_user}","gists_url":"https://api.github.com/users/tomprince/gists{/gist_id}","starred_url":"https://api.github.com/users/tomprince/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomprince/subscriptions","organizations_url":"https://api.github.com/users/tomprince/orgs","repos_url":"https://api.github.com/users/tomprince/repos","events_url":"https://api.github.com/users/tomprince/events{/privacy}","received_events_url":"https://api.github.com/users/tomprince/received_events","type":"User","site_admin":false},"body":"Catch all the errors, since otherwise they'll just leak, since nothing waits on this.","created_at":"2016-04-21T07:03:45Z","updated_at":"2016-04-21T07:03:45Z","html_url":"https://github.com/buildbot/buildbot/pull/2151#discussion_r60534293","pull_request_url":"https://api.github.com/repos/buildbot/buildbot/pulls/2151","_links":{"self":{"href":"https://api.github.com/repos/buildbot/buildbot/pulls/comments/60534293"},"html":{"href":"https://github.com/buildbot/buildbot/pull/2151#discussion_r60534293"},"pull_request":{"href":"https://api.github.com/repos/buildbot/buildbot/pulls/2151"}}},"pull_request":{"url":"https://api.github.com/repos/buildbot/buildbot/pulls/2151","id":67305704,"html_url":"https://github.com/buildbot/buildbot/pull/2151","diff_url":"https://github.com/buildbot/buildbot/pull/2151.diff","patch_url":"https://github.com/buildbot/buildbot/pull/2151.patch","issue_url":"https://api.github.com/repos/buildbot/buildbot/issues/2151","number":2151,"state":"open","locked":false,"title":"Don't wait for build to finish in startBuild.","user":{"login":"tomprince","id":283816,"avatar_url":"https://avatars.githubusercontent.com/u/283816?v=3","gravatar_id":"","url":"https://api.github.com/users/tomprince","html_url":"https://github.com/tomprince","followers_url":"https://api.github.com/users/tomprince/followers","following_url":"https://api.github.com/users/tomprince/following{/other_user}","gists_url":"https://api.github.com/users/tomprince/gists{/gist_id}","starred_url":"https://api.github.com/users/tomprince/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomprince/subscriptions","organizations_url":"https://api.github.com/users/tomprince/orgs","repos_url":"https://api.github.com/users/tomprince/repos","events_url":"https://api.github.com/users/tomprince/events{/privacy}","received_events_url":"https://api.github.com/users/tomprince/received_events","type":"User","site_admin":false},"body":"Trying to do the work to cleanup after a build in `startBuild` makes\r\ncleanup trickier.","created_at":"2016-04-21T06:59:44Z","updated_at":"2016-04-21T07:03:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"68f555489dd8beb55cb8126a59a6c5c3bb5bd1cb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/buildbot/buildbot/pulls/2151/commits","review_comments_url":"https://api.github.com/repos/buildbot/buildbot/pulls/2151/comments","review_comment_url":"https://api.github.com/repos/buildbot/buildbot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/buildbot/buildbot/issues/2151/comments","statuses_url":"https://api.github.com/repos/buildbot/buildbot/statuses/44bf1016d5f169e1d5f3b48f1473789631da7b59","head":{"label":"tomprince:async-build-finished","ref":"async-build-finished","sha":"44bf1016d5f169e1d5f3b48f1473789631da7b59","user":{"login":"tomprince","id":283816,"avatar_url":"https://avatars.githubusercontent.com/u/283816?v=3","gravatar_id":"","url":"https://api.github.com/users/tomprince","html_url":"https://github.com/tomprince","followers_url":"https://api.github.com/users/tomprince/followers","following_url":"https://api.github.com/users/tomprince/following{/other_user}","gists_url":"https://api.github.com/users/tomprince/gists{/gist_id}","starred_url":"https://api.github.com/users/tomprince/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomprince/subscriptions","organizations_url":"https://api.github.com/users/tomprince/orgs","repos_url":"https://api.github.com/users/tomprince/repos","events_url":"https://api.github.com/users/tomprince/events{/privacy}","received_events_url":"https://api.github.com/users/tomprince/received_events","type":"User","site_admin":false},"repo":{"id":1147444,"name":"buildbot","full_name":"tomprince/buildbot","owner":{"login":"tomprince","id":283816,"avatar_url":"https://avatars.githubusercontent.com/u/283816?v=3","gravatar_id":"","url":"https://api.github.com/users/tomprince","html_url":"https://github.com/tomprince","followers_url":"https://api.github.com/users/tomprince/followers","following_url":"https://api.github.com/users/tomprince/following{/other_user}","gists_url":"https://api.github.com/users/tomprince/gists{/gist_id}","starred_url":"https://api.github.com/users/tomprince/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomprince/subscriptions","organizations_url":"https://api.github.com/users/tomprince/orgs","repos_url":"https://api.github.com/users/tomprince/repos","events_url":"https://api.github.com/users/tomprince/events{/privacy}","received_events_url":"https://api.github.com/users/tomprince/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tomprince/buildbot","description":"Python-based continuous integration testing framework; send pull requests for your patches!","fork":true,"url":"https://api.github.com/repos/tomprince/buildbot","forks_url":"https://api.github.com/repos/tomprince/buildbot/forks","keys_url":"https://api.github.com/repos/tomprince/buildbot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tomprince/buildbot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tomprince/buildbot/teams","hooks_url":"https://api.github.com/repos/tomprince/buildbot/hooks","issue_events_url":"https://api.github.com/repos/tomprince/buildbot/issues/events{/number}","events_url":"https://api.github.com/repos/tomprince/buildbot/events","assignees_url":"https://api.github.com/repos/tomprince/buildbot/assignees{/user}","branches_url":"https://api.github.com/repos/tomprince/buildbot/branches{/branch}","tags_url":"https://api.github.com/repos/tomprince/buildbot/tags","blobs_url":"https://api.github.com/repos/tomprince/buildbot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tomprince/buildbot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tomprince/buildbot/git/refs{/sha}","trees_url":"https://api.github.com/repos/tomprince/buildbot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tomprince/buildbot/statuses/{sha}","languages_url":"https://api.github.com/repos/tomprince/buildbot/languages","stargazers_url":"https://api.github.com/repos/tomprince/buildbot/stargazers","contributors_url":"https://api.github.com/repos/tomprince/buildbot/contributors","subscribers_url":"https://api.github.com/repos/tomprince/buildbot/subscribers","subscription_url":"https://api.github.com/repos/tomprince/buildbot/subscription","commits_url":"https://api.github.com/repos/tomprince/buildbot/commits{/sha}","git_commits_url":"https://api.github.com/repos/tomprince/buildbot/git/commits{/sha}","comments_url":"https://api.github.com/repos/tomprince/buildbot/comments{/number}","issue_comment_url":"https://api.github.com/repos/tomprince/buildbot/issues/comments{/number}","contents_url":"https://api.github.com/repos/tomprince/buildbot/contents/{+path}","compare_url":"https://api.github.com/repos/tomprince/buildbot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tomprince/buildbot/merges","archive_url":"https://api.github.com/repos/tomprince/buildbot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tomprince/buildbot/downloads","issues_url":"https://api.github.com/repos/tomprince/buildbot/issues{/number}","pulls_url":"https://api.github.com/repos/tomprince/buildbot/pulls{/number}","milestones_url":"https://api.github.com/repos/tomprince/buildbot/milestones{/number}","notifications_url":"https://api.github.com/repos/tomprince/buildbot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tomprince/buildbot/labels{/name}","releases_url":"https://api.github.com/repos/tomprince/buildbot/releases{/id}","deployments_url":"https://api.github.com/repos/tomprince/buildbot/deployments","created_at":"2010-12-07T19:02:55Z","updated_at":"2015-06-14T19:45:38Z","pushed_at":"2016-04-21T06:58:35Z","git_url":"git://github.com/tomprince/buildbot.git","ssh_url":"git@github.com:tomprince/buildbot.git","clone_url":"https://github.com/tomprince/buildbot.git","svn_url":"https://github.com/tomprince/buildbot","homepage":"http://buildbot.net","size":42068,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"buildbot:master","ref":"master","sha":"9481cbc5e86e3f45a20509262477565e2d37838a","user":{"login":"buildbot","id":324515,"avatar_url":"https://avatars.githubusercontent.com/u/324515?v=3","gravatar_id":"","url":"https://api.github.com/users/buildbot","html_url":"https://github.com/buildbot","followers_url":"https://api.github.com/users/buildbot/followers","following_url":"https://api.github.com/users/buildbot/following{/other_user}","gists_url":"https://api.github.com/users/buildbot/gists{/gist_id}","starred_url":"https://api.github.com/users/buildbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buildbot/subscriptions","organizations_url":"https://api.github.com/users/buildbot/orgs","repos_url":"https://api.github.com/users/buildbot/repos","events_url":"https://api.github.com/users/buildbot/events{/privacy}","received_events_url":"https://api.github.com/users/buildbot/received_events","type":"Organization","site_admin":false},"repo":{"id":760165,"name":"buildbot","full_name":"buildbot/buildbot","owner":{"login":"buildbot","id":324515,"avatar_url":"https://avatars.githubusercontent.com/u/324515?v=3","gravatar_id":"","url":"https://api.github.com/users/buildbot","html_url":"https://github.com/buildbot","followers_url":"https://api.github.com/users/buildbot/followers","following_url":"https://api.github.com/users/buildbot/following{/other_user}","gists_url":"https://api.github.com/users/buildbot/gists{/gist_id}","starred_url":"https://api.github.com/users/buildbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buildbot/subscriptions","organizations_url":"https://api.github.com/users/buildbot/orgs","repos_url":"https://api.github.com/users/buildbot/repos","events_url":"https://api.github.com/users/buildbot/events{/privacy}","received_events_url":"https://api.github.com/users/buildbot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/buildbot/buildbot","description":"Python-based continuous integration testing framework; your pull requests are more than welcome!","fork":false,"url":"https://api.github.com/repos/buildbot/buildbot","forks_url":"https://api.github.com/repos/buildbot/buildbot/forks","keys_url":"https://api.github.com/repos/buildbot/buildbot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/buildbot/buildbot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/buildbot/buildbot/teams","hooks_url":"https://api.github.com/repos/buildbot/buildbot/hooks","issue_events_url":"https://api.github.com/repos/buildbot/buildbot/issues/events{/number}","events_url":"https://api.github.com/repos/buildbot/buildbot/events","assignees_url":"https://api.github.com/repos/buildbot/buildbot/assignees{/user}","branches_url":"https://api.github.com/repos/buildbot/buildbot/branches{/branch}","tags_url":"https://api.github.com/repos/buildbot/buildbot/tags","blobs_url":"https://api.github.com/repos/buildbot/buildbot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/buildbot/buildbot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/buildbot/buildbot/git/refs{/sha}","trees_url":"https://api.github.com/repos/buildbot/buildbot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/buildbot/buildbot/statuses/{sha}","languages_url":"https://api.github.com/repos/buildbot/buildbot/languages","stargazers_url":"https://api.github.com/repos/buildbot/buildbot/stargazers","contributors_url":"https://api.github.com/repos/buildbot/buildbot/contributors","subscribers_url":"https://api.github.com/repos/buildbot/buildbot/subscribers","subscription_url":"https://api.github.com/repos/buildbot/buildbot/subscription","commits_url":"https://api.github.com/repos/buildbot/buildbot/commits{/sha}","git_commits_url":"https://api.github.com/repos/buildbot/buildbot/git/commits{/sha}","comments_url":"https://api.github.com/repos/buildbot/buildbot/comments{/number}","issue_comment_url":"https://api.github.com/repos/buildbot/buildbot/issues/comments{/number}","contents_url":"https://api.github.com/repos/buildbot/buildbot/contents/{+path}","compare_url":"https://api.github.com/repos/buildbot/buildbot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/buildbot/buildbot/merges","archive_url":"https://api.github.com/repos/buildbot/buildbot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/buildbot/buildbot/downloads","issues_url":"https://api.github.com/repos/buildbot/buildbot/issues{/number}","pulls_url":"https://api.github.com/repos/buildbot/buildbot/pulls{/number}","milestones_url":"https://api.github.com/repos/buildbot/buildbot/milestones{/number}","notifications_url":"https://api.github.com/repos/buildbot/buildbot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/buildbot/buildbot/labels{/name}","releases_url":"https://api.github.com/repos/buildbot/buildbot/releases{/id}","deployments_url":"https://api.github.com/repos/buildbot/buildbot/deployments","created_at":"2010-07-06T17:56:53Z","updated_at":"2016-04-20T20:50:21Z","pushed_at":"2016-04-21T06:59:45Z","git_url":"git://github.com/buildbot/buildbot.git","ssh_url":"git@github.com:buildbot/buildbot.git","clone_url":"https://github.com/buildbot/buildbot.git","svn_url":"https://github.com/buildbot/buildbot","homepage":"http://buildbot.net","size":91190,"stargazers_count":2119,"watchers_count":2119,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":873,"mirror_url":null,"open_issues_count":21,"forks":873,"open_issues":21,"watchers":2119,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/buildbot/buildbot/pulls/2151"},"html":{"href":"https://github.com/buildbot/buildbot/pull/2151"},"issue":{"href":"https://api.github.com/repos/buildbot/buildbot/issues/2151"},"comments":{"href":"https://api.github.com/repos/buildbot/buildbot/issues/2151/comments"},"review_comments":{"href":"https://api.github.com/repos/buildbot/buildbot/pulls/2151/comments"},"review_comment":{"href":"https://api.github.com/repos/buildbot/buildbot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/buildbot/buildbot/pulls/2151/commits"},"statuses":{"href":"https://api.github.com/repos/buildbot/buildbot/statuses/44bf1016d5f169e1d5f3b48f1473789631da7b59"}}}}