fluo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] kpm1985 commented on issue #1000: CuratorFramework and IntegrationTest Exceptions
Date Thu, 01 Jan 1970 00:00:00 GMT
kpm1985 commented on issue #1000: CuratorFramework and IntegrationTest Exceptions
URL: https://github.com/apache/fluo/issues/1000#issuecomment-358899764
   @mikewalch @keith-turner @ctubbsii 
   There are a few issues I've identified that are legitimate concerns. For the sake of this
please attention to synchronization.
         synchronized (this) {
           byte[] d = curatorFramework.getData().forPath(maxTsPath);
           currentTs = maxTs = LongUtil.fromByteArray(d);
   Notice the synchronization on these objects from takeLeadership() : non synchronized method
with a synchronized block
     private synchronized long getTimestampsImpl(String id, int num) throws TException {
   Consider this method, it is synchronized. 
   This line is not synchronized. Follow code into this method:
       long newMax = Long.parseLong(new String(d)) + 1000;
       maxTs = newMax;
   Notice there is no synchronization on these. Object monitors and locks to do not inherit.
This is made clear at this line: 
       // do this outside of sync
   I've profiled the code over the last week, this is a race condition that is leading to
a lot of non-deterministic build errors and failures.  

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:

With regards,
Apache Git Services

View raw message