From 29354d4a66a824a8f5ffa1bec0ea5b873bd44969 Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Wed, 4 Dec 2024 09:06:56 -0500 Subject: [PATCH] ARTEMIS-5199 Fixing race on create directory for shared storage This is fixing SharedStoreDistributionTest --- .../core/persistence/impl/journal/JournalStorageManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/JournalStorageManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/JournalStorageManager.java index 827cc5ff89..95499e75e6 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/JournalStorageManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/JournalStorageManager.java @@ -715,7 +715,7 @@ public class JournalStorageManager extends AbstractJournalStorageManager { private void checkAndCreateDir(final File dir, final boolean create) { if (!dir.exists()) { if (create) { - if (!dir.mkdirs()) { + if (!dir.mkdirs() && !dir.exists()) { throw new IllegalStateException("Failed to create directory " + dir); } } else {