{"action":"created","comment":{"url":"https://api.github.com/repos/BD2KGenomics/toil/pulls/comments/68667620","id":68667620,"diff_hunk":"@@ -1153,39 +1185,122 @@ def __getBucketVersioning(self, bucket):\n         for attempt in retry_s3():\n             with attempt:\n                 status = bucket.get_versioning_status()\n-        return bool(status) and self.versionings[status['Versioning']]\n+        return bool(status) and cls.versionings[status['Versioning']]\n \n-    def __getBucketRegion(self, bucket):\n+    @staticmethod\n+    def __getBucketRegion(bucket):\n         for attempt in retry_s3():\n             with attempt:\n                 return bucket_location_to_region(bucket.get_location())\n \n     def deleteJobStore(self):\n-        self.registry_domain.put_attributes(self.namePrefix, dict(exists=str(False)))\n-        if self.filesBucket is not None:\n-            for attempt in retry_s3():\n-                with attempt:\n-                    for upload in self.filesBucket.list_multipart_uploads():\n-                        upload.cancel_upload()\n-            if self.__getBucketVersioning(self.filesBucket) in (True, None):\n+        self.cleanJobStore('aws:%s:%s' % (self.region, self.namePrefix))\n+\n+    @classmethod\n+    def cleanJobStore(cls, locator):\n+        info = cls._processLocator(locator)\n+        filesBucket = None\n+\n+        # First we load all job store components.\n+        try:\n+            with closing(cls._connectS3(info.region)) as s3:\n                 for attempt in retry_s3():\n                     with attempt:\n-                        for key in list(self.filesBucket.list_versions()):\n-                            self.filesBucket.delete_key(key.name, version_id=key.version_id)\n+                        filesBucket = s3.get_bucket('%s%sfiles' %\n+                                                    (info.namePrefix, cls.nameSeparator))\n+        except S3ResponseError as e:\n+            if e.error_code == 'NoSuchBucket':\n+                pass\n             else:\n-                for attempt in retry_s3():\n-                    with attempt:\n-                        for key in list(self.filesBucket.list()):\n-                            key.delete()\n-            for attempt in retry_s3():\n-                with attempt:\n-                    self.filesBucket.delete()\n-        for domain in (self.filesDomain, self.jobsDomain):\n-            if domain is not None:\n-                for attempt in retry_sdb():\n-                    with attempt:\n-                        domain.delete()\n+                raise\n+\n+        def getDomain(name):\n+            # no such domain predicate has been removed to prevent unnecessary retries\n+            predicate = (lambda e: sdb_unavailable(e) or","path":"src/toil/jobStores/aws/jobStore.py","position":200,"original_position":200,"commit_id":"9dc4dac8260b2bbd265e24fc1c8ebe1535e10a34","original_commit_id":"9dc4dac8260b2bbd265e24fc1c8ebe1535e10a34","user":{"login":"hannes-ucsc","id":5143256,"avatar_url":"https://avatars.githubusercontent.com/u/5143256?v=3","gravatar_id":"","url":"https://api.github.com/users/hannes-ucsc","html_url":"https://github.com/hannes-ucsc","followers_url":"https://api.github.com/users/hannes-ucsc/followers","following_url":"https://api.github.com/users/hannes-ucsc/following{/other_user}","gists_url":"https://api.github.com/users/hannes-ucsc/gists{/gist_id}","starred_url":"https://api.github.com/users/hannes-ucsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hannes-ucsc/subscriptions","organizations_url":"https://api.github.com/users/hannes-ucsc/orgs","repos_url":"https://api.github.com/users/hannes-ucsc/repos","events_url":"https://api.github.com/users/hannes-ucsc/events{/privacy}","received_events_url":"https://api.github.com/users/hannes-ucsc/received_events","type":"User","site_admin":false},"body":"Compose the predicate without duplicating the existing one. If the default one is\r\n\r\n```\r\ndef p1():\r\n     return a or b or c or d\r\n```\r\n\r\nmake the new one \r\n\r\n```\r\ndef p2():\r\n    return not d and p1\r\n```","created_at":"2016-06-27T22:24:01Z","updated_at":"2016-06-27T22:24:01Z","html_url":"https://github.com/BD2KGenomics/toil/pull/916#discussion_r68667620","pull_request_url":"https://api.github.com/repos/BD2KGenomics/toil/pulls/916","_links":{"self":{"href":"https://api.github.com/repos/BD2KGenomics/toil/pulls/comments/68667620"},"html":{"href":"https://github.com/BD2KGenomics/toil/pull/916#discussion_r68667620"},"pull_request":{"href":"https://api.github.com/repos/BD2KGenomics/toil/pulls/916"}}},"pull_request":{"url":"https://api.github.com/repos/BD2KGenomics/toil/pulls/916","id":72102637,"html_url":"https://github.com/BD2KGenomics/toil/pull/916","diff_url":"https://github.com/BD2KGenomics/toil/pull/916.diff","patch_url":"https://github.com/BD2KGenomics/toil/pull/916.patch","issue_url":"https://api.github.com/repos/BD2KGenomics/toil/issues/916","number":916,"state":"open","locked":false,"title":"Added robust job store cleaning (resolves #785, resolves #789, resolves #834, resolves #869, resolves #904, resolves #1011)","user":{"login":"JakeNarkizian","id":10471159,"avatar_url":"https://avatars.githubusercontent.com/u/10471159?v=3","gravatar_id":"","url":"https://api.github.com/users/JakeNarkizian","html_url":"https://github.com/JakeNarkizian","followers_url":"https://api.github.com/users/JakeNarkizian/followers","following_url":"https://api.github.com/users/JakeNarkizian/following{/other_user}","gists_url":"https://api.github.com/users/JakeNarkizian/gists{/gist_id}","starred_url":"https://api.github.com/users/JakeNarkizian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JakeNarkizian/subscriptions","organizations_url":"https://api.github.com/users/JakeNarkizian/orgs","repos_url":"https://api.github.com/users/JakeNarkizian/repos","events_url":"https://api.github.com/users/JakeNarkizian/events{/privacy}","received_events_url":"https://api.github.com/users/JakeNarkizian/received_events","type":"User","site_admin":false},"body":"Continued from #835 and #900 \r\n\r\n\r\n\r\n","created_at":"2016-05-31T23:37:46Z","updated_at":"2016-06-27T22:24:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"51007f8b431cefa4b3d00f880525cbc4853c9bf9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/BD2KGenomics/toil/pulls/916/commits","review_comments_url":"https://api.github.com/repos/BD2KGenomics/toil/pulls/916/comments","review_comment_url":"https://api.github.com/repos/BD2KGenomics/toil/pulls/comments{/number}","comments_url":"https://api.github.com/repos/BD2KGenomics/toil/issues/916/comments","statuses_url":"https://api.github.com/repos/BD2KGenomics/toil/statuses/9dc4dac8260b2bbd265e24fc1c8ebe1535e10a34","head":{"label":"BD2KGenomics:issues/785-789-834-864-869-904-robust-clean","ref":"issues/785-789-834-864-869-904-robust-clean","sha":"9dc4dac8260b2bbd265e24fc1c8ebe1535e10a34","user":{"login":"BD2KGenomics","id":8701293,"avatar_url":"https://avatars.githubusercontent.com/u/8701293?v=3","gravatar_id":"","url":"https://api.github.com/users/BD2KGenomics","html_url":"https://github.com/BD2KGenomics","followers_url":"https://api.github.com/users/BD2KGenomics/followers","following_url":"https://api.github.com/users/BD2KGenomics/following{/other_user}","gists_url":"https://api.github.com/users/BD2KGenomics/gists{/gist_id}","starred_url":"https://api.github.com/users/BD2KGenomics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BD2KGenomics/subscriptions","organizations_url":"https://api.github.com/users/BD2KGenomics/orgs","repos_url":"https://api.github.com/users/BD2KGenomics/repos","events_url":"https://api.github.com/users/BD2KGenomics/events{/privacy}","received_events_url":"https://api.github.com/users/BD2KGenomics/received_events","type":"Organization","site_admin":false},"repo":{"id":33148320,"name":"toil","full_name":"BD2KGenomics/toil","owner":{"login":"BD2KGenomics","id":8701293,"avatar_url":"https://avatars.githubusercontent.com/u/8701293?v=3","gravatar_id":"","url":"https://api.github.com/users/BD2KGenomics","html_url":"https://github.com/BD2KGenomics","followers_url":"https://api.github.com/users/BD2KGenomics/followers","following_url":"https://api.github.com/users/BD2KGenomics/following{/other_user}","gists_url":"https://api.github.com/users/BD2KGenomics/gists{/gist_id}","starred_url":"https://api.github.com/users/BD2KGenomics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BD2KGenomics/subscriptions","organizations_url":"https://api.github.com/users/BD2KGenomics/orgs","repos_url":"https://api.github.com/users/BD2KGenomics/repos","events_url":"https://api.github.com/users/BD2KGenomics/events{/privacy}","received_events_url":"https://api.github.com/users/BD2KGenomics/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BD2KGenomics/toil","description":"A scalable, efficient, cross-platform and easy-to-use workflow engine in pure Python","fork":false,"url":"https://api.github.com/repos/BD2KGenomics/toil","forks_url":"https://api.github.com/repos/BD2KGenomics/toil/forks","keys_url":"https://api.github.com/repos/BD2KGenomics/toil/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BD2KGenomics/toil/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BD2KGenomics/toil/teams","hooks_url":"https://api.github.com/repos/BD2KGenomics/toil/hooks","issue_events_url":"https://api.github.com/repos/BD2KGenomics/toil/issues/events{/number}","events_url":"https://api.github.com/repos/BD2KGenomics/toil/events","assignees_url":"https://api.github.com/repos/BD2KGenomics/toil/assignees{/user}","branches_url":"https://api.github.com/repos/BD2KGenomics/toil/branches{/branch}","tags_url":"https://api.github.com/repos/BD2KGenomics/toil/tags","blobs_url":"https://api.github.com/repos/BD2KGenomics/toil/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BD2KGenomics/toil/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BD2KGenomics/toil/git/refs{/sha}","trees_url":"https://api.github.com/repos/BD2KGenomics/toil/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BD2KGenomics/toil/statuses/{sha}","languages_url":"https://api.github.com/repos/BD2KGenomics/toil/languages","stargazers_url":"https://api.github.com/repos/BD2KGenomics/toil/stargazers","contributors_url":"https://api.github.com/repos/BD2KGenomics/toil/contributors","subscribers_url":"https://api.github.com/repos/BD2KGenomics/toil/subscribers","subscription_url":"https://api.github.com/repos/BD2KGenomics/toil/subscription","commits_url":"https://api.github.com/repos/BD2KGenomics/toil/commits{/sha}","git_commits_url":"https://api.github.com/repos/BD2KGenomics/toil/git/commits{/sha}","comments_url":"https://api.github.com/repos/BD2KGenomics/toil/comments{/number}","issue_comment_url":"https://api.github.com/repos/BD2KGenomics/toil/issues/comments{/number}","contents_url":"https://api.github.com/repos/BD2KGenomics/toil/contents/{+path}","compare_url":"https://api.github.com/repos/BD2KGenomics/toil/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BD2KGenomics/toil/merges","archive_url":"https://api.github.com/repos/BD2KGenomics/toil/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BD2KGenomics/toil/downloads","issues_url":"https://api.github.com/repos/BD2KGenomics/toil/issues{/number}","pulls_url":"https://api.github.com/repos/BD2KGenomics/toil/pulls{/number}","milestones_url":"https://api.github.com/repos/BD2KGenomics/toil/milestones{/number}","notifications_url":"https://api.github.com/repos/BD2KGenomics/toil/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BD2KGenomics/toil/labels{/name}","releases_url":"https://api.github.com/repos/BD2KGenomics/toil/releases{/id}","deployments_url":"https://api.github.com/repos/BD2KGenomics/toil/deployments","created_at":"2015-03-30T21:08:58Z","updated_at":"2016-06-14T17:41:39Z","pushed_at":"2016-06-27T20:56:17Z","git_url":"git://github.com/BD2KGenomics/toil.git","ssh_url":"git@github.com:BD2KGenomics/toil.git","clone_url":"https://github.com/BD2KGenomics/toil.git","svn_url":"https://github.com/BD2KGenomics/toil","homepage":"","size":6661,"stargazers_count":190,"watchers_count":190,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":33,"mirror_url":null,"open_issues_count":141,"forks":33,"open_issues":141,"watchers":190,"default_branch":"master"}},"base":{"label":"BD2KGenomics:master","ref":"master","sha":"241a089e6ce9b72bee515dd23a337a93cb87612a","user":{"login":"BD2KGenomics","id":8701293,"avatar_url":"https://avatars.githubusercontent.com/u/8701293?v=3","gravatar_id":"","url":"https://api.github.com/users/BD2KGenomics","html_url":"https://github.com/BD2KGenomics","followers_url":"https://api.github.com/users/BD2KGenomics/followers","following_url":"https://api.github.com/users/BD2KGenomics/following{/other_user}","gists_url":"https://api.github.com/users/BD2KGenomics/gists{/gist_id}","starred_url":"https://api.github.com/users/BD2KGenomics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BD2KGenomics/subscriptions","organizations_url":"https://api.github.com/users/BD2KGenomics/orgs","repos_url":"https://api.github.com/users/BD2KGenomics/repos","events_url":"https://api.github.com/users/BD2KGenomics/events{/privacy}","received_events_url":"https://api.github.com/users/BD2KGenomics/received_events","type":"Organization","site_admin":false},"repo":{"id":33148320,"name":"toil","full_name":"BD2KGenomics/toil","owner":{"login":"BD2KGenomics","id":8701293,"avatar_url":"https://avatars.githubusercontent.com/u/8701293?v=3","gravatar_id":"","url":"https://api.github.com/users/BD2KGenomics","html_url":"https://github.com/BD2KGenomics","followers_url":"https://api.github.com/users/BD2KGenomics/followers","following_url":"https://api.github.com/users/BD2KGenomics/following{/other_user}","gists_url":"https://api.github.com/users/BD2KGenomics/gists{/gist_id}","starred_url":"https://api.github.com/users/BD2KGenomics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BD2KGenomics/subscriptions","organizations_url":"https://api.github.com/users/BD2KGenomics/orgs","repos_url":"https://api.github.com/users/BD2KGenomics/repos","events_url":"https://api.github.com/users/BD2KGenomics/events{/privacy}","received_events_url":"https://api.github.com/users/BD2KGenomics/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BD2KGenomics/toil","description":"A scalable, efficient, cross-platform and easy-to-use workflow engine in pure Python","fork":false,"url":"https://api.github.com/repos/BD2KGenomics/toil","forks_url":"https://api.github.com/repos/BD2KGenomics/toil/forks","keys_url":"https://api.github.com/repos/BD2KGenomics/toil/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BD2KGenomics/toil/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BD2KGenomics/toil/teams","hooks_url":"https://api.github.com/repos/BD2KGenomics/toil/hooks","issue_events_url":"https://api.github.com/repos/BD2KGenomics/toil/issues/events{/number}","events_url":"https://api.github.com/repos/BD2KGenomics/toil/events","assignees_url":"https://api.github.com/repos/BD2KGenomics/toil/assignees{/user}","branches_url":"https://api.github.com/repos/BD2KGenomics/toil/branches{/branch}","tags_url":"https://api.github.com/repos/BD2KGenomics/toil/tags","blobs_url":"https://api.github.com/repos/BD2KGenomics/toil/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BD2KGenomics/toil/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BD2KGenomics/toil/git/refs{/sha}","trees_url":"https://api.github.com/repos/BD2KGenomics/toil/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BD2KGenomics/toil/statuses/{sha}","languages_url":"https://api.github.com/repos/BD2KGenomics/toil/languages","stargazers_url":"https://api.github.com/repos/BD2KGenomics/toil/stargazers","contributors_url":"https://api.github.com/repos/BD2KGenomics/toil/contributors","subscribers_url":"https://api.github.com/repos/BD2KGenomics/toil/subscribers","subscription_url":"https://api.github.com/repos/BD2KGenomics/toil/subscription","commits_url":"https://api.github.com/repos/BD2KGenomics/toil/commits{/sha}","git_commits_url":"https://api.github.com/repos/BD2KGenomics/toil/git/commits{/sha}","comments_url":"https://api.github.com/repos/BD2KGenomics/toil/comments{/number}","issue_comment_url":"https://api.github.com/repos/BD2KGenomics/toil/issues/comments{/number}","contents_url":"https://api.github.com/repos/BD2KGenomics/toil/contents/{+path}","compare_url":"https://api.github.com/repos/BD2KGenomics/toil/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BD2KGenomics/toil/merges","archive_url":"https://api.github.com/repos/BD2KGenomics/toil/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BD2KGenomics/toil/downloads","issues_url":"https://api.github.com/repos/BD2KGenomics/toil/issues{/number}","pulls_url":"https://api.github.com/repos/BD2KGenomics/toil/pulls{/number}","milestones_url":"https://api.github.com/repos/BD2KGenomics/toil/milestones{/number}","notifications_url":"https://api.github.com/repos/BD2KGenomics/toil/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BD2KGenomics/toil/labels{/name}","releases_url":"https://api.github.com/repos/BD2KGenomics/toil/releases{/id}","deployments_url":"https://api.github.com/repos/BD2KGenomics/toil/deployments","created_at":"2015-03-30T21:08:58Z","updated_at":"2016-06-14T17:41:39Z","pushed_at":"2016-06-27T20:56:17Z","git_url":"git://github.com/BD2KGenomics/toil.git","ssh_url":"git@github.com:BD2KGenomics/toil.git","clone_url":"https://github.com/BD2KGenomics/toil.git","svn_url":"https://github.com/BD2KGenomics/toil","homepage":"","size":6661,"stargazers_count":190,"watchers_count":190,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":33,"mirror_url":null,"open_issues_count":141,"forks":33,"open_issues":141,"watchers":190,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/BD2KGenomics/toil/pulls/916"},"html":{"href":"https://github.com/BD2KGenomics/toil/pull/916"},"issue":{"href":"https://api.github.com/repos/BD2KGenomics/toil/issues/916"},"comments":{"href":"https://api.github.com/repos/BD2KGenomics/toil/issues/916/comments"},"review_comments":{"href":"https://api.github.com/repos/BD2KGenomics/toil/pulls/916/comments"},"review_comment":{"href":"https://api.github.com/repos/BD2KGenomics/toil/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/BD2KGenomics/toil/pulls/916/commits"},"statuses":{"href":"https://api.github.com/repos/BD2KGenomics/toil/statuses/9dc4dac8260b2bbd265e24fc1c8ebe1535e10a34"}}}}
{"actor":{"display_login":"hannes-ucsc"}}