Skip to content

Commit

Permalink
Proven that locks are broken due to incorrect ack check ordering.
Browse files Browse the repository at this point in the history
  • Loading branch information
Todd Nine committed Nov 3, 2012
1 parent e9733fc commit dff96df
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Expand Up @@ -147,6 +147,15 @@ public void acquire(HLock lock, long timeout) {
canBeEarlier = readExistingLocks(lock.getPath(), canBeEarlierSortedList);
}

if(logger.isDebugEnabled()){
List<String> canBeEarlierSortedList = Lists.newArrayList(canBeEarlier.keySet());
// sort them
Collections.sort(canBeEarlierSortedList);

String peers = Joiner.on(", ").join(canBeEarlierSortedList);
logger.debug("{} acquired lock. Peers are {}", lock, peers);
}

((HLockImpl) lock).setAcquired(true);
}

Expand Down
4 changes: 2 additions & 2 deletions core/src/test/resources/log4j.xml
Expand Up @@ -6,10 +6,10 @@
<param name="ConversionPattern" value="%d{ABSOLUTE} %5p %c{1}:%L - %m%n" />
</layout>
</appender>
<!-- <logger name="me.prettyprint.cassandra.locking">
<logger name="me.prettyprint.cassandra.locking" additivity="false">
<level value="debug" />
<appender-ref ref="stdout" />
</logger> -->
</logger>
<root>
<priority value="info"></priority>
<appender-ref ref="stdout" />
Expand Down

0 comments on commit dff96df

Please sign in to comment.