diff --git a/service/common/src/main/java/org/apache/polaris/service/persistence/InMemoryPolarisMetaStoreManagerFactory.java b/service/common/src/main/java/org/apache/polaris/service/persistence/InMemoryPolarisMetaStoreManagerFactory.java index 2d51dcd539..4122285b0b 100644 --- a/service/common/src/main/java/org/apache/polaris/service/persistence/InMemoryPolarisMetaStoreManagerFactory.java +++ b/service/common/src/main/java/org/apache/polaris/service/persistence/InMemoryPolarisMetaStoreManagerFactory.java @@ -97,13 +97,13 @@ public synchronized Supplier getOrCreateSessionSupplie private void bootstrapRealmsAndPrintCredentials(List realms) { RootCredentialsSet rootCredentialsSet = RootCredentialsSet.fromEnvironment(); this.bootstrapRealms(realms, rootCredentialsSet); - bootstrappedRealms.addAll(realms); } @Override public Map bootstrapRealms( Iterable realms, RootCredentialsSet rootCredentialsSet) { Map results = super.bootstrapRealms(realms, rootCredentialsSet); + bootstrappedRealms.addAll(results.keySet()); Map presetCredentials = rootCredentialsSet.credentials(); for (String realmId : realms) { @@ -113,6 +113,9 @@ public Map bootstrapRealms( } PrincipalSecretsResult principalSecrets = results.get(realmId); + if (principalSecrets == null) { + continue; // already bootstrapped (possible benign race) + } String msg = String.format(