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:
commit
5f3d6029b1
1 changed files with 2 additions and 1 deletions
|
|
@ -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}]")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue