{"action":"created","comment":{"url":"https://api.github.com/repos/pravega/pravega/pulls/comments/263711597","pull_request_review_id":212197777,"id":263711597,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI2MzcxMTU5Nw==","diff_hunk":"@@ -86,8 +88,30 @@ public static void main(String[] args) {\n                     .restServerConfig(Optional.of(restServerConfig))\n                     .build();\n \n+            Thread.setDefaultUncaughtExceptionHandler((t, e) -> {\n+                log.error(\"Thread {} with stackTrace {} failed with uncaught exception\", t.getName(), t.getStackTrace(), e);              \n+            });\n+\n             ControllerServiceMain controllerServiceMain = new ControllerServiceMain(serviceConfig);\n             controllerServiceMain.startAsync();\n+            Runtime.getRuntime().addShutdownHook(new Thread(() -> {\n+                MemoryMXBean memoryMXBean = ManagementFactory.getMemoryMXBean();\n+                memoryMXBean.setVerbose(true);\n+                log.error(\"Shutdown hook memory usage dump: Heap memory usage: {}, non heap memory usage {}\", memoryMXBean.getHeapMemoryUsage(),","path":"controller/src/main/java/io/pravega/controller/server/Main.java","position":31,"original_position":31,"commit_id":"7ce0d832e6ac53ac230bc096bc244791df57fcb4","original_commit_id":"7ce0d832e6ac53ac230bc096bc244791df57fcb4","user":{"login":"shiveshr","id":13659022,"node_id":"MDQ6VXNlcjEzNjU5MDIy","avatar_url":"https://avatars2.githubusercontent.com/u/13659022?v=4","gravatar_id":"","url":"https://api.github.com/users/shiveshr","html_url":"https://github.com/shiveshr","followers_url":"https://api.github.com/users/shiveshr/followers","following_url":"https://api.github.com/users/shiveshr/following{/other_user}","gists_url":"https://api.github.com/users/shiveshr/gists{/gist_id}","starred_url":"https://api.github.com/users/shiveshr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shiveshr/subscriptions","organizations_url":"https://api.github.com/users/shiveshr/orgs","repos_url":"https://api.github.com/users/shiveshr/repos","events_url":"https://api.github.com/users/shiveshr/events{/privacy}","received_events_url":"https://api.github.com/users/shiveshr/received_events","type":"User","site_admin":false},"body":"this should be info. fixed it. ","created_at":"2019-03-08T09:17:22Z","updated_at":"2019-03-08T09:17:22Z","html_url":"https://github.com/pravega/pravega/pull/3432#discussion_r263711597","pull_request_url":"https://api.github.com/repos/pravega/pravega/pulls/3432","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/pravega/pravega/pulls/comments/263711597"},"html":{"href":"https://github.com/pravega/pravega/pull/3432#discussion_r263711597"},"pull_request":{"href":"https://api.github.com/repos/pravega/pravega/pulls/3432"}},"in_reply_to_id":263696161},"pull_request":{"url":"https://api.github.com/repos/pravega/pravega/pulls/3432","id":259132633,"node_id":"MDExOlB1bGxSZXF1ZXN0MjU5MTMyNjMz","html_url":"https://github.com/pravega/pravega/pull/3432","diff_url":"https://github.com/pravega/pravega/pull/3432.diff","patch_url":"https://github.com/pravega/pravega/pull/3432.patch","issue_url":"https://api.github.com/repos/pravega/pravega/issues/3432","number":3432,"state":"open","locked":false,"title":"Issue 3100: Shutdown hook on controller process","user":{"login":"shiveshr","id":13659022,"node_id":"MDQ6VXNlcjEzNjU5MDIy","avatar_url":"https://avatars2.githubusercontent.com/u/13659022?v=4","gravatar_id":"","url":"https://api.github.com/users/shiveshr","html_url":"https://github.com/shiveshr","followers_url":"https://api.github.com/users/shiveshr/followers","following_url":"https://api.github.com/users/shiveshr/following{/other_user}","gists_url":"https://api.github.com/users/shiveshr/gists{/gist_id}","starred_url":"https://api.github.com/users/shiveshr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shiveshr/subscriptions","organizations_url":"https://api.github.com/users/shiveshr/orgs","repos_url":"https://api.github.com/users/shiveshr/repos","events_url":"https://api.github.com/users/shiveshr/events{/privacy}","received_events_url":"https://api.github.com/users/shiveshr/received_events","type":"User","site_admin":false},"body":"**Change log description**  \r\nAdded shutdown hook to Main class in Controller Service to handle clean shutdown in case the clustermanager sends kill signal. \r\n\r\n**Purpose of the change**  \r\nfixes #3100 \r\n\r\n**What the code does**  \r\nAdds shutdown hook to Main.java which has ControllerServiceMain instance. It sends shutdown signal to ControllerServiceMain which in turn sends shutdown signal to ControllerServiceStarter. A clean shutdown without restart is performed. \r\n\r\nIn addition, we also dump memory usage statistics and threaddumps as optional dumps if enabled via a configuration. \r\n\r\n**How to verify it**  \r\nController should gracefully shutdown in case of a shutdown signal \r\n","created_at":"2019-03-07T14:24:24Z","updated_at":"2019-03-08T09:17:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"58131cc28e61beff275006c1263fcd640b1d97b6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/pravega/pravega/pulls/3432/commits","review_comments_url":"https://api.github.com/repos/pravega/pravega/pulls/3432/comments","review_comment_url":"https://api.github.com/repos/pravega/pravega/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pravega/pravega/issues/3432/comments","statuses_url":"https://api.github.com/repos/pravega/pravega/statuses/7ce0d832e6ac53ac230bc096bc244791df57fcb4","head":{"label":"shiveshr:shutdownhook","ref":"shutdownhook","sha":"7ce0d832e6ac53ac230bc096bc244791df57fcb4","user":{"login":"shiveshr","id":13659022,"node_id":"MDQ6VXNlcjEzNjU5MDIy","avatar_url":"https://avatars2.githubusercontent.com/u/13659022?v=4","gravatar_id":"","url":"https://api.github.com/users/shiveshr","html_url":"https://github.com/shiveshr","followers_url":"https://api.github.com/users/shiveshr/followers","following_url":"https://api.github.com/users/shiveshr/following{/other_user}","gists_url":"https://api.github.com/users/shiveshr/gists{/gist_id}","starred_url":"https://api.github.com/users/shiveshr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shiveshr/subscriptions","organizations_url":"https://api.github.com/users/shiveshr/orgs","repos_url":"https://api.github.com/users/shiveshr/repos","events_url":"https://api.github.com/users/shiveshr/events{/privacy}","received_events_url":"https://api.github.com/users/shiveshr/received_events","type":"User","site_admin":false},"repo":{"id":92372740,"node_id":"MDEwOlJlcG9zaXRvcnk5MjM3Mjc0MA==","name":"pravega-1","full_name":"shiveshr/pravega-1","private":false,"owner":{"login":"shiveshr","id":13659022,"node_id":"MDQ6VXNlcjEzNjU5MDIy","avatar_url":"https://avatars2.githubusercontent.com/u/13659022?v=4","gravatar_id":"","url":"https://api.github.com/users/shiveshr","html_url":"https://github.com/shiveshr","followers_url":"https://api.github.com/users/shiveshr/followers","following_url":"https://api.github.com/users/shiveshr/following{/other_user}","gists_url":"https://api.github.com/users/shiveshr/gists{/gist_id}","starred_url":"https://api.github.com/users/shiveshr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shiveshr/subscriptions","organizations_url":"https://api.github.com/users/shiveshr/orgs","repos_url":"https://api.github.com/users/shiveshr/repos","events_url":"https://api.github.com/users/shiveshr/events{/privacy}","received_events_url":"https://api.github.com/users/shiveshr/received_events","type":"User","site_admin":false},"html_url":"https://github.com/shiveshr/pravega-1","description":"Pravega - Streaming as a new software defined storage primitive","fork":true,"url":"https://api.github.com/repos/shiveshr/pravega-1","forks_url":"https://api.github.com/repos/shiveshr/pravega-1/forks","keys_url":"https://api.github.com/repos/shiveshr/pravega-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shiveshr/pravega-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shiveshr/pravega-1/teams","hooks_url":"https://api.github.com/repos/shiveshr/pravega-1/hooks","issue_events_url":"https://api.github.com/repos/shiveshr/pravega-1/issues/events{/number}","events_url":"https://api.github.com/repos/shiveshr/pravega-1/events","assignees_url":"https://api.github.com/repos/shiveshr/pravega-1/assignees{/user}","branches_url":"https://api.github.com/repos/shiveshr/pravega-1/branches{/branch}","tags_url":"https://api.github.com/repos/shiveshr/pravega-1/tags","blobs_url":"https://api.github.com/repos/shiveshr/pravega-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shiveshr/pravega-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shiveshr/pravega-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/shiveshr/pravega-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shiveshr/pravega-1/statuses/{sha}","languages_url":"https://api.github.com/repos/shiveshr/pravega-1/languages","stargazers_url":"https://api.github.com/repos/shiveshr/pravega-1/stargazers","contributors_url":"https://api.github.com/repos/shiveshr/pravega-1/contributors","subscribers_url":"https://api.github.com/repos/shiveshr/pravega-1/subscribers","subscription_url":"https://api.github.com/repos/shiveshr/pravega-1/subscription","commits_url":"https://api.github.com/repos/shiveshr/pravega-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/shiveshr/pravega-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/shiveshr/pravega-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/shiveshr/pravega-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/shiveshr/pravega-1/contents/{+path}","compare_url":"https://api.github.com/repos/shiveshr/pravega-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shiveshr/pravega-1/merges","archive_url":"https://api.github.com/repos/shiveshr/pravega-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shiveshr/pravega-1/downloads","issues_url":"https://api.github.com/repos/shiveshr/pravega-1/issues{/number}","pulls_url":"https://api.github.com/repos/shiveshr/pravega-1/pulls{/number}","milestones_url":"https://api.github.com/repos/shiveshr/pravega-1/milestones{/number}","notifications_url":"https://api.github.com/repos/shiveshr/pravega-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shiveshr/pravega-1/labels{/name}","releases_url":"https://api.github.com/repos/shiveshr/pravega-1/releases{/id}","deployments_url":"https://api.github.com/repos/shiveshr/pravega-1/deployments","created_at":"2017-05-25T06:31:49Z","updated_at":"2019-03-08T04:38:54Z","pushed_at":"2019-03-08T05:44:18Z","git_url":"git://github.com/shiveshr/pravega-1.git","ssh_url":"git@github.com:shiveshr/pravega-1.git","clone_url":"https://github.com/shiveshr/pravega-1.git","svn_url":"https://github.com/shiveshr/pravega-1","homepage":"http://pravega.io","size":31257,"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":"pravega:master","ref":"master","sha":"7b9fce657cbfba54e9c6bdee24d915f9c731c954","user":{"login":"pravega","id":25698199,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1Njk4MTk5","avatar_url":"https://avatars1.githubusercontent.com/u/25698199?v=4","gravatar_id":"","url":"https://api.github.com/users/pravega","html_url":"https://github.com/pravega","followers_url":"https://api.github.com/users/pravega/followers","following_url":"https://api.github.com/users/pravega/following{/other_user}","gists_url":"https://api.github.com/users/pravega/gists{/gist_id}","starred_url":"https://api.github.com/users/pravega/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pravega/subscriptions","organizations_url":"https://api.github.com/users/pravega/orgs","repos_url":"https://api.github.com/users/pravega/repos","events_url":"https://api.github.com/users/pravega/events{/privacy}","received_events_url":"https://api.github.com/users/pravega/received_events","type":"Organization","site_admin":false},"repo":{"id":63096822,"node_id":"MDEwOlJlcG9zaXRvcnk2MzA5NjgyMg==","name":"pravega","full_name":"pravega/pravega","private":false,"owner":{"login":"pravega","id":25698199,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1Njk4MTk5","avatar_url":"https://avatars1.githubusercontent.com/u/25698199?v=4","gravatar_id":"","url":"https://api.github.com/users/pravega","html_url":"https://github.com/pravega","followers_url":"https://api.github.com/users/pravega/followers","following_url":"https://api.github.com/users/pravega/following{/other_user}","gists_url":"https://api.github.com/users/pravega/gists{/gist_id}","starred_url":"https://api.github.com/users/pravega/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pravega/subscriptions","organizations_url":"https://api.github.com/users/pravega/orgs","repos_url":"https://api.github.com/users/pravega/repos","events_url":"https://api.github.com/users/pravega/events{/privacy}","received_events_url":"https://api.github.com/users/pravega/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/pravega/pravega","description":"Pravega - Streaming as a new software defined storage primitive","fork":false,"url":"https://api.github.com/repos/pravega/pravega","forks_url":"https://api.github.com/repos/pravega/pravega/forks","keys_url":"https://api.github.com/repos/pravega/pravega/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pravega/pravega/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pravega/pravega/teams","hooks_url":"https://api.github.com/repos/pravega/pravega/hooks","issue_events_url":"https://api.github.com/repos/pravega/pravega/issues/events{/number}","events_url":"https://api.github.com/repos/pravega/pravega/events","assignees_url":"https://api.github.com/repos/pravega/pravega/assignees{/user}","branches_url":"https://api.github.com/repos/pravega/pravega/branches{/branch}","tags_url":"https://api.github.com/repos/pravega/pravega/tags","blobs_url":"https://api.github.com/repos/pravega/pravega/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pravega/pravega/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pravega/pravega/git/refs{/sha}","trees_url":"https://api.github.com/repos/pravega/pravega/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pravega/pravega/statuses/{sha}","languages_url":"https://api.github.com/repos/pravega/pravega/languages","stargazers_url":"https://api.github.com/repos/pravega/pravega/stargazers","contributors_url":"https://api.github.com/repos/pravega/pravega/contributors","subscribers_url":"https://api.github.com/repos/pravega/pravega/subscribers","subscription_url":"https://api.github.com/repos/pravega/pravega/subscription","commits_url":"https://api.github.com/repos/pravega/pravega/commits{/sha}","git_commits_url":"https://api.github.com/repos/pravega/pravega/git/commits{/sha}","comments_url":"https://api.github.com/repos/pravega/pravega/comments{/number}","issue_comment_url":"https://api.github.com/repos/pravega/pravega/issues/comments{/number}","contents_url":"https://api.github.com/repos/pravega/pravega/contents/{+path}","compare_url":"https://api.github.com/repos/pravega/pravega/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pravega/pravega/merges","archive_url":"https://api.github.com/repos/pravega/pravega/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pravega/pravega/downloads","issues_url":"https://api.github.com/repos/pravega/pravega/issues{/number}","pulls_url":"https://api.github.com/repos/pravega/pravega/pulls{/number}","milestones_url":"https://api.github.com/repos/pravega/pravega/milestones{/number}","notifications_url":"https://api.github.com/repos/pravega/pravega/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pravega/pravega/labels{/name}","releases_url":"https://api.github.com/repos/pravega/pravega/releases{/id}","deployments_url":"https://api.github.com/repos/pravega/pravega/deployments","created_at":"2016-07-11T19:41:03Z","updated_at":"2019-03-08T08:01:58Z","pushed_at":"2019-03-08T09:04:34Z","git_url":"git://github.com/pravega/pravega.git","ssh_url":"git@github.com:pravega/pravega.git","clone_url":"https://github.com/pravega/pravega.git","svn_url":"https://github.com/pravega/pravega","homepage":"http://pravega.io","size":28784,"stargazers_count":439,"watchers_count":439,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":123,"mirror_url":null,"archived":false,"open_issues_count":302,"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":123,"open_issues":302,"watchers":439,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pravega/pravega/pulls/3432"},"html":{"href":"https://github.com/pravega/pravega/pull/3432"},"issue":{"href":"https://api.github.com/repos/pravega/pravega/issues/3432"},"comments":{"href":"https://api.github.com/repos/pravega/pravega/issues/3432/comments"},"review_comments":{"href":"https://api.github.com/repos/pravega/pravega/pulls/3432/comments"},"review_comment":{"href":"https://api.github.com/repos/pravega/pravega/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pravega/pravega/pulls/3432/commits"},"statuses":{"href":"https://api.github.com/repos/pravega/pravega/statuses/7ce0d832e6ac53ac230bc096bc244791df57fcb4"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"shiveshr"}}