Github user sjcorbett commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/686#discussion_r35915929
  
    --- Diff: 
core/src/main/java/brooklyn/entity/rebind/PeriodicDeltaChangeListener.java ---
    @@ -78,6 +78,8 @@
     
         private static final Logger LOG = 
LoggerFactory.getLogger(PeriodicDeltaChangeListener.class);
     
    +    protected final AtomicInteger checkpointLogCount = new AtomicInteger();
    --- End diff --
    
    I think you should use an `AtomicLong` instead. If `shouldLogCheckpoint` 
were called once per millisecond the integer would overflow in about three and 
a half weeks: `(2^31 - 1) / (1000 * 60 * 60 * 24 * 7) = 3.55`. So 
`shouldLogCheckpoint` will always return true until `checkpointLogCount.get() < 
5` is false. With a Long it would take  292,277 millenia to overflow.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to