{"action":"created","comment":{"url":"https://api.github.com/repos/wso2/andes/pulls/comments/26372788","id":26372788,"diff_hunk":"@@ -555,77 +560,81 @@ public boolean deleteSlot(String queueName, Slot emptySlot, String nodeId) {\n      * @param queueName name of the queue whose slots to be reassigned\n      */\n     public void reAssignSlotWhenNoSubscribers(String nodeId, String queueName) {\n-        TreeSet<Slot> assignedSlotList = null;\n-        String lockKeyForNodeId = nodeId + SlotManagerClusterMode.class;\n-        synchronized (lockKeyForNodeId.intern()) {\n \n-            //Get assigned slots from Hazelcast, delete all belonging to queue\n-            //and set back\n-            HashmapStringTreeSetWrapper wrapper = slotAssignmentMap.get(nodeId);\n-            HashMap<String, TreeSet<Slot>> queueToSlotMap = null;\n-            if (wrapper != null) {\n-                queueToSlotMap = wrapper.getStringListHashMap();\n-            }\n-            if (queueToSlotMap != null) {\n-                assignedSlotList = queueToSlotMap.remove(queueName);\n-                wrapper.setStringListHashMap(queueToSlotMap);\n-                slotAssignmentMap.set(nodeId, wrapper);\n-            }\n+        // Hazelcast could be shut down before hitting this method in case of a server shutdown event. Therefore the check.\n+        if (AndesContext.getInstance().isClusteringEnabled() && HazelcastAgent.getInstance().isActive()) {\n+            TreeSet<Slot> assignedSlotList = null;\n+            String lockKeyForNodeId = nodeId + SlotManagerClusterMode.class;\n+            synchronized (lockKeyForNodeId.intern()) {\n \n-            if(log.isDebugEnabled()) {\n-                log.debug(\"Cleared assigned slots of queue \" + queueName + \" Assigned to node \" +\n-                        nodeId);\n-            }\n+                //Get assigned slots from Hazelcast, delete all belonging to queue\n+                //and set back\n+                HashmapStringTreeSetWrapper wrapper = slotAssignmentMap.get(nodeId);\n+                HashMap<String, TreeSet<Slot>> queueToSlotMap = null;\n+                if (wrapper != null) {","path":"modules/andes-core/broker/src/main/java/org/wso2/andes/kernel/slot/SlotManagerClusterMode.java","position":null,"original_position":200,"commit_id":"e101723ab29e1e0e9527bf50ecae392df18770b7","original_commit_id":"71606d600d677331358c3a69c272ca7f41a600fa","user":{"login":"hastef88","id":5869348,"avatar_url":"https://avatars.githubusercontent.com/u/5869348?v=3","gravatar_id":"","url":"https://api.github.com/users/hastef88","html_url":"https://github.com/hastef88","followers_url":"https://api.github.com/users/hastef88/followers","following_url":"https://api.github.com/users/hastef88/following{/other_user}","gists_url":"https://api.github.com/users/hastef88/gists{/gist_id}","starred_url":"https://api.github.com/users/hastef88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hastef88/subscriptions","organizations_url":"https://api.github.com/users/hastef88/orgs","repos_url":"https://api.github.com/users/hastef88/repos","events_url":"https://api.github.com/users/hastef88/events{/privacy}","received_events_url":"https://api.github.com/users/hastef88/received_events","type":"User","site_admin":false},"body":"done","created_at":"2015-03-13T09:23:46Z","updated_at":"2015-03-13T09:23:46Z","html_url":"https://github.com/wso2/andes/pull/68#discussion_r26372788","pull_request_url":"https://api.github.com/repos/wso2/andes/pulls/68","_links":{"self":{"href":"https://api.github.com/repos/wso2/andes/pulls/comments/26372788"},"html":{"href":"https://github.com/wso2/andes/pull/68#discussion_r26372788"},"pull_request":{"href":"https://api.github.com/repos/wso2/andes/pulls/68"}}},"pull_request":{"url":"https://api.github.com/repos/wso2/andes/pulls/68","id":31032000,"html_url":"https://github.com/wso2/andes/pull/68","diff_url":"https://github.com/wso2/andes/pull/68.diff","patch_url":"https://github.com/wso2/andes/pull/68.patch","issue_url":"https://api.github.com/repos/wso2/andes/issues/68","number":68,"state":"open","locked":false,"title":"Fix Jiras 964 and 970","user":{"login":"hastef88","id":5869348,"avatar_url":"https://avatars.githubusercontent.com/u/5869348?v=3","gravatar_id":"","url":"https://api.github.com/users/hastef88","html_url":"https://github.com/hastef88","followers_url":"https://api.github.com/users/hastef88/followers","following_url":"https://api.github.com/users/hastef88/following{/other_user}","gists_url":"https://api.github.com/users/hastef88/gists{/gist_id}","starred_url":"https://api.github.com/users/hastef88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hastef88/subscriptions","organizations_url":"https://api.github.com/users/hastef88/orgs","repos_url":"https://api.github.com/users/hastef88/repos","events_url":"https://api.github.com/users/hastef88/events{/privacy}","received_events_url":"https://api.github.com/users/hastef88/received_events","type":"User","site_admin":false},"body":"Handling exceptions occurring during server shutdown. Utilize Carbon ShutdownEventListener to close any isolated worker threads (e.g. SlotManager).\r\n\r\nHandle HazelcastInstanceNotActiveException ","created_at":"2015-03-12T12:43:32Z","updated_at":"2015-03-13T09:23:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"84bdb953ae571b6b385ec4162a5a654a83232092","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wso2/andes/pulls/68/commits","review_comments_url":"https://api.github.com/repos/wso2/andes/pulls/68/comments","review_comment_url":"https://api.github.com/repos/wso2/andes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wso2/andes/issues/68/comments","statuses_url":"https://api.github.com/repos/wso2/andes/statuses/e101723ab29e1e0e9527bf50ecae392df18770b7","head":{"label":"hastef88:fix_jiras_964_970","ref":"fix_jiras_964_970","sha":"e101723ab29e1e0e9527bf50ecae392df18770b7","user":{"login":"hastef88","id":5869348,"avatar_url":"https://avatars.githubusercontent.com/u/5869348?v=3","gravatar_id":"","url":"https://api.github.com/users/hastef88","html_url":"https://github.com/hastef88","followers_url":"https://api.github.com/users/hastef88/followers","following_url":"https://api.github.com/users/hastef88/following{/other_user}","gists_url":"https://api.github.com/users/hastef88/gists{/gist_id}","starred_url":"https://api.github.com/users/hastef88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hastef88/subscriptions","organizations_url":"https://api.github.com/users/hastef88/orgs","repos_url":"https://api.github.com/users/hastef88/repos","events_url":"https://api.github.com/users/hastef88/events{/privacy}","received_events_url":"https://api.github.com/users/hastef88/received_events","type":"User","site_admin":false},"repo":{"id":30342142,"name":"andes","full_name":"hastef88/andes","owner":{"login":"hastef88","id":5869348,"avatar_url":"https://avatars.githubusercontent.com/u/5869348?v=3","gravatar_id":"","url":"https://api.github.com/users/hastef88","html_url":"https://github.com/hastef88","followers_url":"https://api.github.com/users/hastef88/followers","following_url":"https://api.github.com/users/hastef88/following{/other_user}","gists_url":"https://api.github.com/users/hastef88/gists{/gist_id}","starred_url":"https://api.github.com/users/hastef88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hastef88/subscriptions","organizations_url":"https://api.github.com/users/hastef88/orgs","repos_url":"https://api.github.com/users/hastef88/repos","events_url":"https://api.github.com/users/hastef88/events{/privacy}","received_events_url":"https://api.github.com/users/hastef88/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hastef88/andes","description":"","fork":true,"url":"https://api.github.com/repos/hastef88/andes","forks_url":"https://api.github.com/repos/hastef88/andes/forks","keys_url":"https://api.github.com/repos/hastef88/andes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hastef88/andes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hastef88/andes/teams","hooks_url":"https://api.github.com/repos/hastef88/andes/hooks","issue_events_url":"https://api.github.com/repos/hastef88/andes/issues/events{/number}","events_url":"https://api.github.com/repos/hastef88/andes/events","assignees_url":"https://api.github.com/repos/hastef88/andes/assignees{/user}","branches_url":"https://api.github.com/repos/hastef88/andes/branches{/branch}","tags_url":"https://api.github.com/repos/hastef88/andes/tags","blobs_url":"https://api.github.com/repos/hastef88/andes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hastef88/andes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hastef88/andes/git/refs{/sha}","trees_url":"https://api.github.com/repos/hastef88/andes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hastef88/andes/statuses/{sha}","languages_url":"https://api.github.com/repos/hastef88/andes/languages","stargazers_url":"https://api.github.com/repos/hastef88/andes/stargazers","contributors_url":"https://api.github.com/repos/hastef88/andes/contributors","subscribers_url":"https://api.github.com/repos/hastef88/andes/subscribers","subscription_url":"https://api.github.com/repos/hastef88/andes/subscription","commits_url":"https://api.github.com/repos/hastef88/andes/commits{/sha}","git_commits_url":"https://api.github.com/repos/hastef88/andes/git/commits{/sha}","comments_url":"https://api.github.com/repos/hastef88/andes/comments{/number}","issue_comment_url":"https://api.github.com/repos/hastef88/andes/issues/comments{/number}","contents_url":"https://api.github.com/repos/hastef88/andes/contents/{+path}","compare_url":"https://api.github.com/repos/hastef88/andes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hastef88/andes/merges","archive_url":"https://api.github.com/repos/hastef88/andes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hastef88/andes/downloads","issues_url":"https://api.github.com/repos/hastef88/andes/issues{/number}","pulls_url":"https://api.github.com/repos/hastef88/andes/pulls{/number}","milestones_url":"https://api.github.com/repos/hastef88/andes/milestones{/number}","notifications_url":"https://api.github.com/repos/hastef88/andes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hastef88/andes/labels{/name}","releases_url":"https://api.github.com/repos/hastef88/andes/releases{/id}","created_at":"2015-02-05T06:51:08Z","updated_at":"2015-03-12T04:46:34Z","pushed_at":"2015-03-13T09:21:37Z","git_url":"git://github.com/hastef88/andes.git","ssh_url":"git@github.com:hastef88/andes.git","clone_url":"https://github.com/hastef88/andes.git","svn_url":"https://github.com/hastef88/andes","homepage":null,"size":63967,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"wso2:master","ref":"master","sha":"659d5e1e932a33a34aea3dbc7bcc88912a55c926","user":{"login":"wso2","id":533043,"avatar_url":"https://avatars.githubusercontent.com/u/533043?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2","html_url":"https://github.com/wso2","followers_url":"https://api.github.com/users/wso2/followers","following_url":"https://api.github.com/users/wso2/following{/other_user}","gists_url":"https://api.github.com/users/wso2/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2/subscriptions","organizations_url":"https://api.github.com/users/wso2/orgs","repos_url":"https://api.github.com/users/wso2/repos","events_url":"https://api.github.com/users/wso2/events{/privacy}","received_events_url":"https://api.github.com/users/wso2/received_events","type":"Organization","site_admin":false},"repo":{"id":20559270,"name":"andes","full_name":"wso2/andes","owner":{"login":"wso2","id":533043,"avatar_url":"https://avatars.githubusercontent.com/u/533043?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2","html_url":"https://github.com/wso2","followers_url":"https://api.github.com/users/wso2/followers","following_url":"https://api.github.com/users/wso2/following{/other_user}","gists_url":"https://api.github.com/users/wso2/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2/subscriptions","organizations_url":"https://api.github.com/users/wso2/orgs","repos_url":"https://api.github.com/users/wso2/repos","events_url":"https://api.github.com/users/wso2/events{/privacy}","received_events_url":"https://api.github.com/users/wso2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wso2/andes","description":"","fork":false,"url":"https://api.github.com/repos/wso2/andes","forks_url":"https://api.github.com/repos/wso2/andes/forks","keys_url":"https://api.github.com/repos/wso2/andes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wso2/andes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wso2/andes/teams","hooks_url":"https://api.github.com/repos/wso2/andes/hooks","issue_events_url":"https://api.github.com/repos/wso2/andes/issues/events{/number}","events_url":"https://api.github.com/repos/wso2/andes/events","assignees_url":"https://api.github.com/repos/wso2/andes/assignees{/user}","branches_url":"https://api.github.com/repos/wso2/andes/branches{/branch}","tags_url":"https://api.github.com/repos/wso2/andes/tags","blobs_url":"https://api.github.com/repos/wso2/andes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wso2/andes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wso2/andes/git/refs{/sha}","trees_url":"https://api.github.com/repos/wso2/andes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wso2/andes/statuses/{sha}","languages_url":"https://api.github.com/repos/wso2/andes/languages","stargazers_url":"https://api.github.com/repos/wso2/andes/stargazers","contributors_url":"https://api.github.com/repos/wso2/andes/contributors","subscribers_url":"https://api.github.com/repos/wso2/andes/subscribers","subscription_url":"https://api.github.com/repos/wso2/andes/subscription","commits_url":"https://api.github.com/repos/wso2/andes/commits{/sha}","git_commits_url":"https://api.github.com/repos/wso2/andes/git/commits{/sha}","comments_url":"https://api.github.com/repos/wso2/andes/comments{/number}","issue_comment_url":"https://api.github.com/repos/wso2/andes/issues/comments{/number}","contents_url":"https://api.github.com/repos/wso2/andes/contents/{+path}","compare_url":"https://api.github.com/repos/wso2/andes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wso2/andes/merges","archive_url":"https://api.github.com/repos/wso2/andes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wso2/andes/downloads","issues_url":"https://api.github.com/repos/wso2/andes/issues{/number}","pulls_url":"https://api.github.com/repos/wso2/andes/pulls{/number}","milestones_url":"https://api.github.com/repos/wso2/andes/milestones{/number}","notifications_url":"https://api.github.com/repos/wso2/andes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wso2/andes/labels{/name}","releases_url":"https://api.github.com/repos/wso2/andes/releases{/id}","created_at":"2014-06-06T10:04:24Z","updated_at":"2015-03-11T13:01:42Z","pushed_at":"2015-03-11T13:01:42Z","git_url":"git://github.com/wso2/andes.git","ssh_url":"git@github.com:wso2/andes.git","clone_url":"https://github.com/wso2/andes.git","svn_url":"https://github.com/wso2/andes","homepage":null,"size":65341,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":30,"mirror_url":null,"open_issues_count":4,"forks":30,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wso2/andes/pulls/68"},"html":{"href":"https://github.com/wso2/andes/pull/68"},"issue":{"href":"https://api.github.com/repos/wso2/andes/issues/68"},"comments":{"href":"https://api.github.com/repos/wso2/andes/issues/68/comments"},"review_comments":{"href":"https://api.github.com/repos/wso2/andes/pulls/68/comments"},"review_comment":{"href":"https://api.github.com/repos/wso2/andes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wso2/andes/pulls/68/commits"},"statuses":{"href":"https://api.github.com/repos/wso2/andes/statuses/e101723ab29e1e0e9527bf50ecae392df18770b7"}}}}