-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix 560 #579
Fix 560 #579
Conversation
Thanks @MonkeyCanCode. However, after applying this fix (and tentative ones for #561 + #562), I'm not sure whether it's worth to fix it now. I think it makes more sense to wait until #469 has landed, because it will clean up a bunch of things. Not sure about this particular one, but let's wait and see what @adutra thinks. |
initializeForRealm(realmContext); | ||
checkPolarisServiceBootstrappedForRealm( | ||
realmContext, metaStoreManagerMap.get(realmContext.getRealmIdentifier())); | ||
} else { | ||
checkPolarisServiceBootstrappedForRealm( | ||
realmContext, metaStoreManagerMap.get(realmContext.getRealmIdentifier())); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initializeForRealm(realmContext); | |
checkPolarisServiceBootstrappedForRealm( | |
realmContext, metaStoreManagerMap.get(realmContext.getRealmIdentifier())); | |
} else { | |
checkPolarisServiceBootstrappedForRealm( | |
realmContext, metaStoreManagerMap.get(realmContext.getRealmIdentifier())); | |
} | |
initializeForRealm(realmContext); | |
} | |
checkPolarisServiceBootstrappedForRealm( | |
realmContext, metaStoreManagerMap.get(realmContext.getRealmIdentifier())); |
I'd say let's get this in, as I think the race condition would be possible even after the switch to Quarkus (the switch doesn't change the logic in |
The issue arises because the second curl command does not return the correct status code due to the behavior of
getOrCreateSessionSupplier
. When a realm is not found, the method triggers realm initialization. However, realm initialization only partially bootstraps the setup (it creates the sequence object with default and populated tables but no data). As a result, when the second curl command is executed, it attempts credential validation instead of the expected check, since the schema for the required tables is created during the realm initialization.To ensure consistent error handling and avoid premature credential validation, this PR adds an additional check to verify that the realm is fully bootstrapped before proceeding with credential validation.