[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-9888?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

jay updated CLOUDSTACK-9888:
----------------------------
    Description: 
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);
                    }




  was:
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 processes rest of the events even though they are processed, 
this causes duplication of usage records.


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);
                    }





> 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.3.15#6346)

Reply via email to