[ https://issues.apache.org/jira/browse/CLOUDSTACK-9888?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16305384#comment-16305384 ]
ASF GitHub Bot commented on CLOUDSTACK-9888: -------------------------------------------- blueorangutan commented on issue #2058: CLOUDSTACK-9888: Duplicate usage while processing usage events URL: https://github.com/apache/cloudstack/pull/2058#issuecomment-354278008 Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1522 ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Duplicate usage while processing usage events > --------------------------------------------- > > Key: CLOUDSTACK-9888 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9888 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Reporter: jay > > Usage manager start processing events from current date or last processed > event. > In case of exception, exception is suppressed in the current implementation > and usage server process rest of the events. > when usage server starts again it picks the unprocessed event (due to > exception) and reports the usage from unprocessed event date. > To avoid duplication usage server should stop when ever there is an exception. > code: > Date oldestEventDate = events.get(0).getCreateDate(); > if (oldestEventDate.getTime() < startDateMillis) { > startDateMillis = oldestEventDate.getTime(); > startDate = new Date(startDateMillis); > } -- This message was sent by Atlassian JIRA (v6.4.14#64029)