payload: {"action":"created","comment":{"url":"https://api.github.com/repos/criteo/garmadon/pulls/comments/268068937","pull_request_review_id":217629402,"id":268068937,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI2ODA2ODkzNw==","diff_hunk":"@@ -88,15 +90,23 @@ public static void main(String[] args) throws IOException {\n         final String baseTemporaryHdfsDir = config.getHdfs().getBaseTemporaryDir();\n         final Path finalHdfsDir = new Path(config.getHdfs().getFinalDir());\n \n-\n-        FileSystem fs = null;\n         try {\n             fs = finalHdfsDir.getFileSystem(HDFS_CONF);\n         } catch (IOException e) {\n             LOGGER.error(\"Could not initialize HDFS\", e);\n             exit(1);\n         }\n \n+        // Add Shutdown Hook to close FS and delete temp folders\n+        Runtime.getRuntime().addShutdownHook(new Thread(() -> {\n+            try {\n+                fs.close();\n+            } catch (IOException e) {\n+                LOGGER.error(\"Could not close FS\", e);\n+                exit(1);","path":"readers/hdfs/src/main/java/com/criteo/hadoop/garmadon/hdfs/HdfsExporter.java","position":28,"original_position":28,"commit_id":"eef00edc465c7e85efa267cb5418db2fcd2affab","original_commit_id":"eef00edc465c7e85efa267cb5418db2fcd2affab","user":{"login":"ashangit","id":6404013,"node_id":"MDQ6VXNlcjY0MDQwMTM=","avatar_url":"https://avatars1.githubusercontent.com/u/6404013?v=4","gravatar_id":"","url":"https://api.github.com/users/ashangit","html_url":"https://github.com/ashangit","followers_url":"https://api.github.com/users/ashangit/followers","following_url":"https://api.github.com/users/ashangit/following{/other_user}","gists_url":"https://api.github.com/users/ashangit/gists{/gist_id}","starred_url":"https://api.github.com/users/ashangit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashangit/subscriptions","organizations_url":"https://api.github.com/users/ashangit/orgs","repos_url":"https://api.github.com/users/ashangit/repos","events_url":"https://api.github.com/users/ashangit/events{/privacy}","received_events_url":"https://api.github.com/users/ashangit/received_events","type":"User","site_admin":false},"body":"Good catch","created_at":"2019-03-22T08:15:34Z","updated_at":"2019-03-22T08:15:34Z","html_url":"https://github.com/criteo/garmadon/pull/118#discussion_r268068937","pull_request_url":"https://api.github.com/repos/criteo/garmadon/pulls/118","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/criteo/garmadon/pulls/comments/268068937"},"html":{"href":"https://github.com/criteo/garmadon/pull/118#discussion_r268068937"},"pull_request":{"href":"https://api.github.com/repos/criteo/garmadon/pulls/118"}},"in_reply_to_id":266044765},"pull_request":{"url":"https://api.github.com/repos/criteo/garmadon/pulls/118","id":261544076,"node_id":"MDExOlB1bGxSZXF1ZXN0MjYxNTQ0MDc2","html_url":"https://github.com/criteo/garmadon/pull/118","diff_url":"https://github.com/criteo/garmadon/pull/118.diff","patch_url":"https://github.com/criteo/garmadon/pull/118.patch","issue_url":"https://api.github.com/repos/criteo/garmadon/issues/118","number":118,"state":"open","locked":false,"title":"Remove temporary hdfs folder at reader shutdown","user":{"login":"ashangit","id":6404013,"node_id":"MDQ6VXNlcjY0MDQwMTM=","avatar_url":"https://avatars1.githubusercontent.com/u/6404013?v=4","gravatar_id":"","url":"https://api.github.com/users/ashangit","html_url":"https://github.com/ashangit","followers_url":"https://api.github.com/users/ashangit/followers","following_url":"https://api.github.com/users/ashangit/following{/other_user}","gists_url":"https://api.github.com/users/ashangit/gists{/gist_id}","starred_url":"https://api.github.com/users/ashangit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashangit/subscriptions","organizations_url":"https://api.github.com/users/ashangit/orgs","repos_url":"https://api.github.com/users/ashangit/repos","events_url":"https://api.github.com/users/ashangit/events{/privacy}","received_events_url":"https://api.github.com/users/ashangit/received_events","type":"User","site_admin":false},"body":"Currently folders in hdfs temp folder based on UUID are never deleted leading\r\nto lots of files/folders beeing kept on hdfs\r\nOn normal run we must ensure that those folders are reclaimed at shutdown","created_at":"2019-03-15T13:07:02Z","updated_at":"2019-03-22T08:15:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"560a6f2bfe390ea216026f958d008c496b016cc8","assignee":null,"assignees":[],"requested_reviewers":[{"login":"mchataigner","id":2926444,"node_id":"MDQ6VXNlcjI5MjY0NDQ=","avatar_url":"https://avatars0.githubusercontent.com/u/2926444?v=4","gravatar_id":"","url":"https://api.github.com/users/mchataigner","html_url":"https://github.com/mchataigner","followers_url":"https://api.github.com/users/mchataigner/followers","following_url":"https://api.github.com/users/mchataigner/following{/other_user}","gists_url":"https://api.github.com/users/mchataigner/gists{/gist_id}","starred_url":"https://api.github.com/users/mchataigner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mchataigner/subscriptions","organizations_url":"https://api.github.com/users/mchataigner/orgs","repos_url":"https://api.github.com/users/mchataigner/repos","events_url":"https://api.github.com/users/mchataigner/events{/privacy}","received_events_url":"https://api.github.com/users/mchataigner/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/criteo/garmadon/pulls/118/commits","review_comments_url":"https://api.github.com/repos/criteo/garmadon/pulls/118/comments","review_comment_url":"https://api.github.com/repos/criteo/garmadon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/criteo/garmadon/issues/118/comments","statuses_url":"https://api.github.com/repos/criteo/garmadon/statuses/eef00edc465c7e85efa267cb5418db2fcd2affab","head":{"label":"ashangit:hdfs_reader","ref":"hdfs_reader","sha":"eef00edc465c7e85efa267cb5418db2fcd2affab","user":{"login":"ashangit","id":6404013,"node_id":"MDQ6VXNlcjY0MDQwMTM=","avatar_url":"https://avatars1.githubusercontent.com/u/6404013?v=4","gravatar_id":"","url":"https://api.github.com/users/ashangit","html_url":"https://github.com/ashangit","followers_url":"https://api.github.com/users/ashangit/followers","following_url":"https://api.github.com/users/ashangit/following{/other_user}","gists_url":"https://api.github.com/users/ashangit/gists{/gist_id}","starred_url":"https://api.github.com/users/ashangit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashangit/subscriptions","organizations_url":"https://api.github.com/users/ashangit/orgs","repos_url":"https://api.github.com/users/ashangit/repos","events_url":"https://api.github.com/users/ashangit/events{/privacy}","received_events_url":"https://api.github.com/users/ashangit/received_events","type":"User","site_admin":false},"repo":{"id":154850722,"node_id":"MDEwOlJlcG9zaXRvcnkxNTQ4NTA3MjI=","name":"garmadon","full_name":"ashangit/garmadon","private":false,"owner":{"login":"ashangit","id":6404013,"node_id":"MDQ6VXNlcjY0MDQwMTM=","avatar_url":"https://avatars1.githubusercontent.com/u/6404013?v=4","gravatar_id":"","url":"https://api.github.com/users/ashangit","html_url":"https://github.com/ashangit","followers_url":"https://api.github.com/users/ashangit/followers","following_url":"https://api.github.com/users/ashangit/following{/other_user}","gists_url":"https://api.github.com/users/ashangit/gists{/gist_id}","starred_url":"https://api.github.com/users/ashangit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashangit/subscriptions","organizations_url":"https://api.github.com/users/ashangit/orgs","repos_url":"https://api.github.com/users/ashangit/repos","events_url":"https://api.github.com/users/ashangit/events{/privacy}","received_events_url":"https://api.github.com/users/ashangit/received_events","type":"User","site_admin":false},"html_url":"https://github.com/ashangit/garmadon","description":"Java event logs collector for hadoop and frameworks","fork":true,"url":"https://api.github.com/repos/ashangit/garmadon","forks_url":"https://api.github.com/repos/ashangit/garmadon/forks","keys_url":"https://api.github.com/repos/ashangit/garmadon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ashangit/garmadon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ashangit/garmadon/teams","hooks_url":"https://api.github.com/repos/ashangit/garmadon/hooks","issue_events_url":"https://api.github.com/repos/ashangit/garmadon/issues/events{/number}","events_url":"https://api.github.com/repos/ashangit/garmadon/events","assignees_url":"https://api.github.com/repos/ashangit/garmadon/assignees{/user}","branches_url":"https://api.github.com/repos/ashangit/garmadon/branches{/branch}","tags_url":"https://api.github.com/repos/ashangit/garmadon/tags","blobs_url":"https://api.github.com/repos/ashangit/garmadon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ashangit/garmadon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ashangit/garmadon/git/refs{/sha}","trees_url":"https://api.github.com/repos/ashangit/garmadon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ashangit/garmadon/statuses/{sha}","languages_url":"https://api.github.com/repos/ashangit/garmadon/languages","stargazers_url":"https://api.github.com/repos/ashangit/garmadon/stargazers","contributors_url":"https://api.github.com/repos/ashangit/garmadon/contributors","subscribers_url":"https://api.github.com/repos/ashangit/garmadon/subscribers","subscription_url":"https://api.github.com/repos/ashangit/garmadon/subscription","commits_url":"https://api.github.com/repos/ashangit/garmadon/commits{/sha}","git_commits_url":"https://api.github.com/repos/ashangit/garmadon/git/commits{/sha}","comments_url":"https://api.github.com/repos/ashangit/garmadon/comments{/number}","issue_comment_url":"https://api.github.com/repos/ashangit/garmadon/issues/comments{/number}","contents_url":"https://api.github.com/repos/ashangit/garmadon/contents/{+path}","compare_url":"https://api.github.com/repos/ashangit/garmadon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ashangit/garmadon/merges","archive_url":"https://api.github.com/repos/ashangit/garmadon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ashangit/garmadon/downloads","issues_url":"https://api.github.com/repos/ashangit/garmadon/issues{/number}","pulls_url":"https://api.github.com/repos/ashangit/garmadon/pulls{/number}","milestones_url":"https://api.github.com/repos/ashangit/garmadon/milestones{/number}","notifications_url":"https://api.github.com/repos/ashangit/garmadon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ashangit/garmadon/labels{/name}","releases_url":"https://api.github.com/repos/ashangit/garmadon/releases{/id}","deployments_url":"https://api.github.com/repos/ashangit/garmadon/deployments","created_at":"2018-10-26T14:53:21Z","updated_at":"2018-10-26T14:53:24Z","pushed_at":"2019-03-20T17:08:35Z","git_url":"git://github.com/ashangit/garmadon.git","ssh_url":"git@github.com:ashangit/garmadon.git","clone_url":"https://github.com/ashangit/garmadon.git","svn_url":"https://github.com/ashangit/garmadon","homepage":"","size":10004,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"criteo:master","ref":"master","sha":"d08fec697e6ff097b30ad875dbdbcae96b4e5f5e","user":{"login":"criteo","id":1713646,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3MTM2NDY=","avatar_url":"https://avatars2.githubusercontent.com/u/1713646?v=4","gravatar_id":"","url":"https://api.github.com/users/criteo","html_url":"https://github.com/criteo","followers_url":"https://api.github.com/users/criteo/followers","following_url":"https://api.github.com/users/criteo/following{/other_user}","gists_url":"https://api.github.com/users/criteo/gists{/gist_id}","starred_url":"https://api.github.com/users/criteo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/criteo/subscriptions","organizations_url":"https://api.github.com/users/criteo/orgs","repos_url":"https://api.github.com/users/criteo/repos","events_url":"https://api.github.com/users/criteo/events{/privacy}","received_events_url":"https://api.github.com/users/criteo/received_events","type":"Organization","site_admin":false},"repo":{"id":152245376,"node_id":"MDEwOlJlcG9zaXRvcnkxNTIyNDUzNzY=","name":"garmadon","full_name":"criteo/garmadon","private":false,"owner":{"login":"criteo","id":1713646,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3MTM2NDY=","avatar_url":"https://avatars2.githubusercontent.com/u/1713646?v=4","gravatar_id":"","url":"https://api.github.com/users/criteo","html_url":"https://github.com/criteo","followers_url":"https://api.github.com/users/criteo/followers","following_url":"https://api.github.com/users/criteo/following{/other_user}","gists_url":"https://api.github.com/users/criteo/gists{/gist_id}","starred_url":"https://api.github.com/users/criteo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/criteo/subscriptions","organizations_url":"https://api.github.com/users/criteo/orgs","repos_url":"https://api.github.com/users/criteo/repos","events_url":"https://api.github.com/users/criteo/events{/privacy}","received_events_url":"https://api.github.com/users/criteo/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/criteo/garmadon","description":"Java event logs collector for hadoop and frameworks","fork":false,"url":"https://api.github.com/repos/criteo/garmadon","forks_url":"https://api.github.com/repos/criteo/garmadon/forks","keys_url":"https://api.github.com/repos/criteo/garmadon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/criteo/garmadon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/criteo/garmadon/teams","hooks_url":"https://api.github.com/repos/criteo/garmadon/hooks","issue_events_url":"https://api.github.com/repos/criteo/garmadon/issues/events{/number}","events_url":"https://api.github.com/repos/criteo/garmadon/events","assignees_url":"https://api.github.com/repos/criteo/garmadon/assignees{/user}","branches_url":"https://api.github.com/repos/criteo/garmadon/branches{/branch}","tags_url":"https://api.github.com/repos/criteo/garmadon/tags","blobs_url":"https://api.github.com/repos/criteo/garmadon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/criteo/garmadon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/criteo/garmadon/git/refs{/sha}","trees_url":"https://api.github.com/repos/criteo/garmadon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/criteo/garmadon/statuses/{sha}","languages_url":"https://api.github.com/repos/criteo/garmadon/languages","stargazers_url":"https://api.github.com/repos/criteo/garmadon/stargazers","contributors_url":"https://api.github.com/repos/criteo/garmadon/contributors","subscribers_url":"https://api.github.com/repos/criteo/garmadon/subscribers","subscription_url":"https://api.github.com/repos/criteo/garmadon/subscription","commits_url":"https://api.github.com/repos/criteo/garmadon/commits{/sha}","git_commits_url":"https://api.github.com/repos/criteo/garmadon/git/commits{/sha}","comments_url":"https://api.github.com/repos/criteo/garmadon/comments{/number}","issue_comment_url":"https://api.github.com/repos/criteo/garmadon/issues/comments{/number}","contents_url":"https://api.github.com/repos/criteo/garmadon/contents/{+path}","compare_url":"https://api.github.com/repos/criteo/garmadon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/criteo/garmadon/merges","archive_url":"https://api.github.com/repos/criteo/garmadon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/criteo/garmadon/downloads","issues_url":"https://api.github.com/repos/criteo/garmadon/issues{/number}","pulls_url":"https://api.github.com/repos/criteo/garmadon/pulls{/number}","milestones_url":"https://api.github.com/repos/criteo/garmadon/milestones{/number}","notifications_url":"https://api.github.com/repos/criteo/garmadon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/criteo/garmadon/labels{/name}","releases_url":"https://api.github.com/repos/criteo/garmadon/releases{/id}","deployments_url":"https://api.github.com/repos/criteo/garmadon/deployments","created_at":"2018-10-09T12:15:07Z","updated_at":"2019-03-13T11:14:49Z","pushed_at":"2019-03-21T16:00:15Z","git_url":"git://github.com/criteo/garmadon.git","ssh_url":"git@github.com:criteo/garmadon.git","clone_url":"https://github.com/criteo/garmadon.git","svn_url":"https://github.com/criteo/garmadon","homepage":"","size":9334,"stargazers_count":16,"watchers_count":16,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10,"mirror_url":null,"archived":false,"open_issues_count":12,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":10,"open_issues":12,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/criteo/garmadon/pulls/118"},"html":{"href":"https://github.com/criteo/garmadon/pull/118"},"issue":{"href":"https://api.github.com/repos/criteo/garmadon/issues/118"},"comments":{"href":"https://api.github.com/repos/criteo/garmadon/issues/118/comments"},"review_comments":{"href":"https://api.github.com/repos/criteo/garmadon/pulls/118/comments"},"review_comment":{"href":"https://api.github.com/repos/criteo/garmadon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/criteo/garmadon/pulls/118/commits"},"statuses":{"href":"https://api.github.com/repos/criteo/garmadon/statuses/eef00edc465c7e85efa267cb5418db2fcd2affab"}},"author_association":"CONTRIBUTOR"}}
other: {"actor":{"display_login":"ashangit"}}