{"action":"closed","issue":{"url":"https://api.github.com/repos/hazelcast/hazelcast/issues/5554","labels_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/5554/labels{/name}","comments_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/5554/comments","events_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/5554/events","html_url":"https://github.com/hazelcast/hazelcast/issues/5554","id":90091283,"number":5554,"title":"IMap.destroy() - map is destroyed and then immediately recreated","user":{"login":"bzlat","id":3177627,"avatar_url":"https://avatars.githubusercontent.com/u/3177627?v=3","gravatar_id":"","url":"https://api.github.com/users/bzlat","html_url":"https://github.com/bzlat","followers_url":"https://api.github.com/users/bzlat/followers","following_url":"https://api.github.com/users/bzlat/following{/other_user}","gists_url":"https://api.github.com/users/bzlat/gists{/gist_id}","starred_url":"https://api.github.com/users/bzlat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bzlat/subscriptions","organizations_url":"https://api.github.com/users/bzlat/orgs","repos_url":"https://api.github.com/users/bzlat/repos","events_url":"https://api.github.com/users/bzlat/events{/privacy}","received_events_url":"https://api.github.com/users/bzlat/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hazelcast/hazelcast/labels/Team:%20Client","name":"Team: Client","color":"99ccff"},{"url":"https://api.github.com/repos/hazelcast/hazelcast/labels/Team:%20Core","name":"Team: Core","color":"eb6420"},{"url":"https://api.github.com/repos/hazelcast/hazelcast/labels/Type:%20Defect","name":"Type: Defect","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"eminn","id":378108,"avatar_url":"https://avatars.githubusercontent.com/u/378108?v=3","gravatar_id":"","url":"https://api.github.com/users/eminn","html_url":"https://github.com/eminn","followers_url":"https://api.github.com/users/eminn/followers","following_url":"https://api.github.com/users/eminn/following{/other_user}","gists_url":"https://api.github.com/users/eminn/gists{/gist_id}","starred_url":"https://api.github.com/users/eminn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eminn/subscriptions","organizations_url":"https://api.github.com/users/eminn/orgs","repos_url":"https://api.github.com/users/eminn/repos","events_url":"https://api.github.com/users/eminn/events{/privacy}","received_events_url":"https://api.github.com/users/eminn/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/hazelcast/hazelcast/milestones/61","html_url":"https://github.com/hazelcast/hazelcast/milestones/3.6","labels_url":"https://api.github.com/repos/hazelcast/hazelcast/milestones/61/labels","id":982584,"number":61,"title":"3.6","description":"","creator":{"login":"enesakar","id":234086,"avatar_url":"https://avatars.githubusercontent.com/u/234086?v=3","gravatar_id":"","url":"https://api.github.com/users/enesakar","html_url":"https://github.com/enesakar","followers_url":"https://api.github.com/users/enesakar/followers","following_url":"https://api.github.com/users/enesakar/following{/other_user}","gists_url":"https://api.github.com/users/enesakar/gists{/gist_id}","starred_url":"https://api.github.com/users/enesakar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enesakar/subscriptions","organizations_url":"https://api.github.com/users/enesakar/orgs","repos_url":"https://api.github.com/users/enesakar/repos","events_url":"https://api.github.com/users/enesakar/events{/privacy}","received_events_url":"https://api.github.com/users/enesakar/received_events","type":"User","site_admin":false},"open_issues":109,"closed_issues":786,"state":"open","created_at":"2015-02-17T09:27:09Z","updated_at":"2015-11-12T07:25:51Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2015-06-22T12:57:22Z","updated_at":"2015-11-12T07:25:51Z","closed_at":"2015-11-12T07:25:51Z","body":"Creating this issue as suggested by @bilalyasar (see [discussion on the Hazelcast Google Groups forum] (https://groups.google.com/forum/#!topic/hazelcast/G1P43tORJPA))\r\n\r\nHazelcast version that you use: ```3.4.2```, ```3.5```\r\nCluster size: ```1```\r\nNumber of the clients: ```1```\r\nVersion of Java: ```OracleJDK 1.7.0_80, x86_64```, ```OracleJDK 1.8.0_45, x86_64```\r\nOperating system: ```OS X Yosemite 10.10.3 (14D136)```\r\nLogs and stack traces: See the console output from executing the TestNG test case below\r\nDetailed description of the steps to reproduce your issue: See the TestNG test case below\r\nUnit test with the hazelcast.xml file: \r\n\r\n```java\r\nimport static org.testng.Assert.assertEquals;\r\nimport static org.testng.Assert.assertNotNull;\r\n\r\nimport org.testng.annotations.AfterClass;\r\nimport org.testng.annotations.BeforeClass;\r\nimport org.testng.annotations.Test;\r\n\r\nimport com.hazelcast.client.HazelcastClient;\r\nimport com.hazelcast.core.DistributedObjectEvent;\r\nimport com.hazelcast.core.DistributedObjectListener;\r\nimport com.hazelcast.core.Hazelcast;\r\nimport com.hazelcast.core.HazelcastInstance;\r\nimport com.hazelcast.core.IMap;\r\n\r\npublic class IMapDestroyTest {\r\n\r\n\tprivate HazelcastInstance server;\r\n\tprivate HazelcastInstance client;\r\n\r\n\t@BeforeClass\r\n\tpublic void setUpBeforeClass() {\r\n\t\tserver = Hazelcast.newHazelcastInstance();\r\n\t\tsleep(2000);\r\n\t\tclient = HazelcastClient.newHazelcastClient();\r\n\t\tclient.addDistributedObjectListener(new DistributedObjectListener() {\r\n\t\t\t@Override public void distributedObjectDestroyed(final DistributedObjectEvent event) {\r\n\t\t\t\tSystem.out.println(\"\\n\\tdistributedObjectDestroyed(): \" + event);\r\n\t\t\t}\r\n\t\t\t@Override public void distributedObjectCreated(final DistributedObjectEvent event) {\r\n\t\t\t\tSystem.out.println(\"\\n\\tdistributedObjectCreated(): \" + event);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t@AfterClass\r\n\tpublic void tearDownAfterClass() {\r\n\t\tclient.shutdown();\r\n\t\tserver.shutdown();\r\n\t}\r\n\r\n\t@Test\r\n\tpublic void testIMapDestroy() {\r\n\t\tSystem.out.print(\"Creating 'foo' map... \");\r\n\t\tIMap<String, String> fooMap = client.getMap(\"foo\");\r\n\t\tassertNotNull(fooMap);\r\n\t\tSystem.out.println(\"done.\");\r\n\t\tSystem.out.println(\"All known distributed objects: \" + client.getDistributedObjects());\r\n\t\tSystem.out.print(\"Inserting an entry... \");\r\n\t\tfooMap.put(\"fu\", \"bar\");\r\n\t\tSystem.out.print(\"done.\\nRetrieving the entry... \");\r\n\t\tString value = fooMap.get(\"fu\");\r\n\t\tassertEquals(value, \"bar\");\r\n\t\tSystem.out.print(\"done.\\nDestroying the map... \");\r\n\t\tfooMap.destroy();\r\n\t\tSystem.out.println(\"done.\");\r\n\t\tSystem.out.println(\"All known distributed objects: \" + client.getDistributedObjects());\r\n\t}\r\n\r\n\tprivate void sleep(final int millis) {\r\n\t\ttry {\r\n\t\t\tThread.sleep(millis);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\tThread.currentThread().interrupt();\r\n\t\t}\r\n\t}\r\n}\r\n```\r\n\r\nConsole output:\r\n```\r\nCreating 'foo' map...\r\n        distributedObjectCreated(): DistributedObjectEvent{eventType=CREATED, serviceName='hz:impl:mapService', distributedObject=IMap{name='foo'}}\r\ndone.\r\nAll known distributed objects: [IMap{name='foo'}]\r\nInserting an entry... done.\r\nRetrieving the entry... done.\r\nDestroying the map...\r\n        distributedObjectDestroyed(): DistributedObjectEvent{eventType=DESTROYED, serviceName='hz:impl:mapService', distributedObject=IMap{name='foo'}}\r\n        distributedObjectCreated(): DistributedObjectEvent{eventType=CREATED, serviceName='hz:impl:mapService', distributedObject=IMap{name='foo'}}\r\ndone.\r\nAll known distributed objects: [IMap{name='foo'}]\r\n```"}}