really this would look nicer if we counld just do:

```
indexShardRepository.lock()

try {
....

} finally {
  indexShardRepository.unlock()
} 
```