Permalink
Browse files

Deadlock fix

thread 1 gets lock on indexName, from getNextId, for instance
thread 2 calls synch'd getShardInfo method
thread 1 calls getShardInfo inside of indexName lock, blocks waiting
for thread 2 to finish
thread 2 hits the indexName lock inside of getShardInfo and deadlocks

traced all paths and made some lock changes:
- nextReservedId is only called from inside indexName lock, so no need
to lock it in that method
- almost all calls to getShardInfo were inside of an indexName lock, so
took out the indexName lock in that method
- added an indexName lock around the getShardInfo call inside of
getMaxId, for safety's sake
  • Loading branch information...
1 parent 7b18f06 commit b533b818f3bcde9cc93ccbdb0e3572af96a998f3 Steven Scott committed Jan 23, 2012
Showing with 257 additions and 263 deletions.
  1. +257 −263 src/lucandra/cluster/CassandraIndexManager.java
Oops, something went wrong.

0 comments on commit b533b81

Please sign in to comment.