-
Notifications
You must be signed in to change notification settings - Fork 661
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-17450 StatusTool with pure Java code #2712
Conversation
2f5493d
to
9f03425
Compare
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.
Loving it...
We can put a call out to the community for testing on Windows... @Willdotwhite would you be interested in taking this PR for a spin on Windows? |
I'd be happy to, although I'm away from my Windows machine until next weekend at the earliest I'm afraid! Is there any particular time pressure on this? |
It's open source and volunteer driven ;-). So any time is a great time! I do appreciate you and @rahulgoswami stepping up to do the Windows verification work. It makes me a lot more confident about being able to evolve the CLI. |
I removed the RuntimePermission for |
There's a reproducible failure since |
So the reason is that in |
Scan only pid files by default
Co-authored-by: Christos Malliaridis <[email protected]>
So I did a few changes and found a few bugs: The status tool with no args now defaults to inspecting the PID files in Then I found that the resolving of pid dir was flawed. If It still did not work on Windows since I assumed that the PID file on windows was a real PID file. But it isn't. It is a So now we look up process by port if on windows and by pid if on Linux. Tests also updated. Running some tests on win. |
Did more testing. The output when starting Solr on Win was broken and printed the json status text on Win, while on Linux it still printed |
I love how instead of making StatusTool help output more complex, you added the "stealth" idea that honestly we may use in other places! |
Remove duplicate printout "Found 1 Solr nodes:"
Did another pass at cleaning up some convoluted code, and remove some duplicate printout. Here I have copied the command response from some local tests. Will probably commit soon if you think it looks good:
With no processes running:
|
Note that until now, the only supported syntax has been |
I compared with outputs from v9.7:
|
Co-authored-by: Christos Malliaridis <[email protected]> (cherry picked from commit 2391f49)
@janhoy After the merge of this PR I have multiple tests that fail on Windows with I'd like to see the security manager being removed in |
https://issues.apache.org/jira/browse/SOLR-17450
This moves the meat of
bin/solr status
command to StatusTool, removing someps | grep java
logic in both scripts.Instead, we use the Java 9
ProcessHandle
API to interact with list of operating system processes, so we can find running instances of Solr.The new
SolrProcessMgr
class is made standalone since it can also be used elsewhere to interact with solr processes...I updated
test_status.bats
, but did not keep the old logic of allowing no arguments. Instead we expose botn--solr-url
and-p
so you can ask for status for another Solr. If you supply no args, it behaves like before, scanning for all running solrs. I added these to bats.The output is probably not 100% same as it used to.
Windows script changes not tested at all...