Merge pull request #15376 from akka/wip-13898-failed-SharedLeveldbJournalSpec-master-ban

=per #13898 Make LocalSnapshotStore directory creation more robust (Validation)
This commit is contained in:
Björn Antonsson 2014-06-09 14:06:03 +02:00
commit 5f3d6029b1

View file

@ -111,7 +111,8 @@ private[persistence] class LocalSnapshotStore extends SnapshotStore with ActorLo
override def preStart() {
if (!snapshotDir.isDirectory) {
if (!snapshotDir.mkdirs()) {
// try to create the directory, on failure double check if someone else beat us to it
if (!snapshotDir.mkdirs() && !snapshotDir.isDirectory) {
throw new IOException(s"Failed to create snapshot directory [${snapshotDir.getCanonicalPath}]")
}
}