-
Notifications
You must be signed in to change notification settings - Fork 694
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
SOLR-17644: Fix missing auth listener #3208
base: main
Are you sure you want to change the base?
Conversation
This is not the final solution. I created this to initiate discussion on the best possible approach to solving this. |
Test case!
|
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.
Shouldn't this PR include a test like Colvin shared -- https://github.com/colvinco/solr/blob/f2e8825c5e46180eb121f20a69f246092ad60776/solr/core/src/test/org/apache/solr/security/BasicAuthIntegrationTest.java#L398-L403 so we can verify the fix?
(Doubtful but asking anyway) Is the bug a result of ZkController.getSolrCloudManager lazy creating the client instead of eager? I'm suspicious the lazy load saves anything of consequence.
Maybe CoreContainer.loadInternal needs to move these lines:
securityConfHandler =
isZooKeeperAware() ? new SecurityConfHandlerZk(this) : new SecurityConfHandlerLocal(this);
reloadSecurityProperties();
to immediately after zkSys.initZooKeeper....
![]() It's not about the lazy loading. zkSys.initZooKeeper(this, cfg.getCloudConfig()); is what triggers somewhere But as you can see in the IF block we initialize the solr/solr/core/src/java/org/apache/solr/core/CoreContainer.java Lines 868 to 880 in 76c09a3
|
I would prefer we initialize the httpClients with security as soon as possible, before they are obtained, even if the design seems to support dynamic changes after creation. It'd be better to guarantee the initialization has happened. But it seems to awkward to guarantee that right now. On my mind is dependency-injection frameworks which can manage complex object graphs with dependencies for startup initialization. Any way that's kind of a fantasy right now, and a big undertaking to embrace that. I thought of a really simple solution here. I'm skeptical that ZkController.getSolrCloudManager truly needs to create yet another Http2SolrClient instance. It could use |
https://issues.apache.org/jira/browse/SOLR-17644
Checklist
Please review the following and check all that apply:
main
branch../gradlew check
.