{"action":"closed","issue":{"url":"https://api.github.com/repos/hazelcast/hazelcast/issues/4855","labels_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/4855/labels{/name}","comments_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/4855/comments","events_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/4855/events","html_url":"https://github.com/hazelcast/hazelcast/issues/4855","id":63492111,"number":4855,"title":"NPE Slow operation detector","user":{"login":"pveentjer","id":105243,"avatar_url":"https://avatars.githubusercontent.com/u/105243?v=3","gravatar_id":"","url":"https://api.github.com/users/pveentjer","html_url":"https://github.com/pveentjer","followers_url":"https://api.github.com/users/pveentjer/followers","following_url":"https://api.github.com/users/pveentjer/following{/other_user}","gists_url":"https://api.github.com/users/pveentjer/gists{/gist_id}","starred_url":"https://api.github.com/users/pveentjer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pveentjer/subscriptions","organizations_url":"https://api.github.com/users/pveentjer/orgs","repos_url":"https://api.github.com/users/pveentjer/repos","events_url":"https://api.github.com/users/pveentjer/events{/privacy}","received_events_url":"https://api.github.com/users/pveentjer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hazelcast/hazelcast/labels/Team:%20QuSP","name":"Team: QuSP","color":"009800"},{"url":"https://api.github.com/repos/hazelcast/hazelcast/labels/Type:%20Defect","name":"Type: Defect","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"Donnerbart","id":4196298,"avatar_url":"https://avatars.githubusercontent.com/u/4196298?v=3","gravatar_id":"","url":"https://api.github.com/users/Donnerbart","html_url":"https://github.com/Donnerbart","followers_url":"https://api.github.com/users/Donnerbart/followers","following_url":"https://api.github.com/users/Donnerbart/following{/other_user}","gists_url":"https://api.github.com/users/Donnerbart/gists{/gist_id}","starred_url":"https://api.github.com/users/Donnerbart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Donnerbart/subscriptions","organizations_url":"https://api.github.com/users/Donnerbart/orgs","repos_url":"https://api.github.com/users/Donnerbart/repos","events_url":"https://api.github.com/users/Donnerbart/events{/privacy}","received_events_url":"https://api.github.com/users/Donnerbart/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/hazelcast/hazelcast/milestones/55","html_url":"https://github.com/hazelcast/hazelcast/milestones/3.5","labels_url":"https://api.github.com/repos/hazelcast/hazelcast/milestones/55/labels","id":819785,"number":55,"title":"3.5","description":null,"creator":{"login":"sancar","id":570462,"avatar_url":"https://avatars.githubusercontent.com/u/570462?v=3","gravatar_id":"","url":"https://api.github.com/users/sancar","html_url":"https://github.com/sancar","followers_url":"https://api.github.com/users/sancar/followers","following_url":"https://api.github.com/users/sancar/following{/other_user}","gists_url":"https://api.github.com/users/sancar/gists{/gist_id}","starred_url":"https://api.github.com/users/sancar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sancar/subscriptions","organizations_url":"https://api.github.com/users/sancar/orgs","repos_url":"https://api.github.com/users/sancar/repos","events_url":"https://api.github.com/users/sancar/events{/privacy}","received_events_url":"https://api.github.com/users/sancar/received_events","type":"User","site_admin":false},"open_issues":111,"closed_issues":305,"state":"open","created_at":"2014-10-09T13:04:53Z","updated_at":"2015-03-31T13:24:02Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2015-03-22T05:34:25Z","updated_at":"2015-03-31T13:24:02Z","closed_at":"2015-03-31T13:24:02Z","body":"I think it is caused by a data race. \r\n\r\n* So the OperationRunner.currentTask is seen as slow.\r\n* The operation completes, so current task is null\r\n* The SlowOperationLog is created by accessing the OperationRunner.currentTask. \r\nwhich leads to the NPE. \r\n\r\nSo make sure you take a 'snapshot' of reality that is valid instead of dealing with something that moves underneath your feet. In most cases storing the operation in a local variable (and passing it around) is the best approach to deal with this.\r\n\r\nCould also be that something else is happening :)\r\n\r\n```\r\nException in thread \"hz._hzInstance_39_dev.SlowOperationDetectorThread\" java.lang.NullPointerException\r\n\tat com.hazelcast.spi.impl.operationexecutor.slowoperationdetector.SlowOperationLog.<init>(SlowOperationLog.java:59)\r\n\tat com.hazelcast.spi.impl.operationexecutor.slowoperationdetector.SlowOperationDetector$DetectorThread.getOrCreateSlowOperationLog(SlowOperationDetector.java:206)\r\n\tat com.hazelcast.spi.impl.operationexecutor.slowoperationdetector.SlowOperationDetector$DetectorThread.scanOperationRunner(SlowOperationDetector.java:184)\r\n\tat com.hazelcast.spi.impl.operationexecutor.slowoperationdetector.SlowOperationDetector$DetectorThread.scan(SlowOperationDetector.java:157)\r\n\tat com.hazelcast.spi.impl.operationexecutor.slowoperationdetector.SlowOperationDetector$DetectorThread.run(SlowOperationDetector.java:138)\r\n```"}}