{"action":"created","issue":{"url":"https://api.github.com/repos/hazelcast/hazelcast/issues/11929","repository_url":"https://api.github.com/repos/hazelcast/hazelcast","labels_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/11929/labels{/name}","comments_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/11929/comments","events_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/11929/events","html_url":"https://github.com/hazelcast/hazelcast/issues/11929","id":280076174,"number":11929,"title":"ScheduledTaskStatistics.getLastRunDuration() returns negative values for quick executions","user":{"login":"bedrin","id":4654384,"avatar_url":"https://avatars3.githubusercontent.com/u/4654384?v=4","gravatar_id":"","url":"https://api.github.com/users/bedrin","html_url":"https://github.com/bedrin","followers_url":"https://api.github.com/users/bedrin/followers","following_url":"https://api.github.com/users/bedrin/following{/other_user}","gists_url":"https://api.github.com/users/bedrin/gists{/gist_id}","starred_url":"https://api.github.com/users/bedrin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bedrin/subscriptions","organizations_url":"https://api.github.com/users/bedrin/orgs","repos_url":"https://api.github.com/users/bedrin/repos","events_url":"https://api.github.com/users/bedrin/events{/privacy}","received_events_url":"https://api.github.com/users/bedrin/received_events","type":"User","site_admin":false},"labels":[{"id":137752575,"url":"https://api.github.com/repos/hazelcast/hazelcast/labels/Team:%20Core","name":"Team: Core","color":"109def","default":false},{"id":680491059,"url":"https://api.github.com/repos/hazelcast/hazelcast/labels/To%20Triage","name":"To Triage","color":"1d76db","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-12-07T10:26:11Z","updated_at":"2017-12-07T14:19:58Z","closed_at":null,"author_association":"NONE","body":"I can see that for some of my scheduled jobs getLastRunDuration() returns negative values.\r\nIssue is intermittent. It seems that it is triggered by fast jobs"},"comment":{"url":"https://api.github.com/repos/hazelcast/hazelcast/issues/comments/349980188","html_url":"https://github.com/hazelcast/hazelcast/issues/11929#issuecomment-349980188","issue_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/11929","id":349980188,"user":{"login":"bedrin","id":4654384,"avatar_url":"https://avatars3.githubusercontent.com/u/4654384?v=4","gravatar_id":"","url":"https://api.github.com/users/bedrin","html_url":"https://github.com/bedrin","followers_url":"https://api.github.com/users/bedrin/followers","following_url":"https://api.github.com/users/bedrin/following{/other_user}","gists_url":"https://api.github.com/users/bedrin/gists{/gist_id}","starred_url":"https://api.github.com/users/bedrin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bedrin/subscriptions","organizations_url":"https://api.github.com/users/bedrin/orgs","repos_url":"https://api.github.com/users/bedrin/repos","events_url":"https://api.github.com/users/bedrin/events{/privacy}","received_events_url":"https://api.github.com/users/bedrin/received_events","type":"User","site_admin":false},"created_at":"2017-12-07T14:19:58Z","updated_at":"2017-12-07T14:19:58Z","author_association":"NONE","body":"Sorry, cannot share any code from office.\r\n\r\nBasically what I do is call schedule job at fixed rate R (say 1 minute) and immediately after that start a timer (vanila java Timer from JRE) with the same rate which calls IScheduledFuture.getStats() method\r\n\r\nIf my job takes a few seconds to execute, IScheduledFuture.getStats() called from Timer will get into race-condition described above and print the difference between lastRunEnd from previous execution and lastRunStart from current execution which is obviously negative"}}
{"actor":{"display_login":"bedrin"}}