-
Notifications
You must be signed in to change notification settings - Fork 674
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-15960 Unified use of system properties and environment variables #1935
Conversation
Test on SOLR_LOG_LEVEL and SOLR_MODULES Support JSON array string to list
Tests pass, @epugh can you have a first quick review and tell if this helps your CLI work? After your first feedback I can invite more reviewers. I feel the principle is well proven by the fact that I removed explicit parsing of I want to keep the scope of this PR somewhat limited. Can follow up with new PRs that remove cruft from the scripts. |
Would then the preferred access mode for getting properties be via |
Such moves can be considered for sure. The |
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.
This looks like a great step in the right direction! I don't yet have like a immediate "hey, this totally solved one of the CLI issues", but I bet it helps. Bigger is that in the future, maybe folks can use either system properties or environment variables to configure Solr without it being a battle ;-).
Thanks for your review @dsmiley and sorry for late response. I updated PR. |
…vars such as SOLR_CIRCUITBREAKER_UPDATE_CPU
In 28400bb I removed yet 20 lines from bin/solr :) |
… getProp* methods are blocking.
@HoustonPutman Thanks to your BATS ssl tests, we caught a problem in this PR. Needed to exclude all |
Disabled locking and tests pass. I seem to recall that the GlobalCircuitBreaker tests would break. I’ll try some beasting over Christmas.. |
Could not make the CB tests fail with beasting. So I fully removed all locking code. We'll soon discover if there are issues. |
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.
Thanks for getting back to something simpler :-)
Thanks for the extra review. Will merge to main tomorrow. |
I went to check if Ref Guide was updated, and sure enough it was! |
https://issues.apache.org/jira/browse/SOLR-15960
This is a first step, demonstrating how we can skip converting env.vars like
SOLR_FOO
in bin/solr and then passing them as-Dsolr.foo
. Instead we just provide Solr with all theSOLR_*
environment variables, and let the newEnvUtils
class convert and set the proper system propertis. Our Solr code can then continue readingSystem.getProperty("solr.foo")
as before.We have some exceptions to the naming convention, and for those there is a properties file to map ENV -> prop key.
Some places in Solr we look for either env.var or sys.prop and pick the one that exists. This is no longer necessary, as you can just read the sys.prop and it will be set if the corresponding ENV was passed to Solr.
This PR gives a few examples of cleanup that can be done, by removing explicit parsing of
SOLR_LOG_LEVEL
andSOLR_MODULES
from start scripts. Tons of other places can also be simplified, but to keep this PR small, this is probably a nice first step, then other can follow in other PRs.