SOLR-18336, SOLR-18665: Wait for Jetty's state file when starting Solr #5389
All Vouch review confidence checks passed
Residual risk 0.23 = Change Risk (0.43) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 396 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.358
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #5389"
general
weight: 0.35
janhoy
https://issues.apache.org/jira/browse/SOLR-18336
https://issues.apache.org/jira/browse/SOLR-18665
Replaces the two draft PRs #4710 (SOLR-18336) and #5368 (SOLR-18665) with one script-only change.
bin/solr startandbin\solr.cmd startno longer call the node over HTTP to see that it has started. Background starts enable a newstateJetty module (the stockStateLifeCycleListener), and the scripts wait forSTARTEDinSOLR_PID_DIR/solr-<port>.state, next to the PID file.FAILEDstate, such as a port conflict, ends the wait at once instead of afterSOLR_START_WAIT.bin/solrhas always printed. On failuresolr.cmdnow also shows the last 30 lines ofsolr.log, using PowerShell.StatusTool. The start wait no longer launches a second JVM.How the Jetty state file works
Jetty ships a
StateLifeCycleListenerthat appends one line to a file for each lifecycle change of the server:STARTING,STARTED,FAILED,STOPPING,STOPPED. Jetty's ownstatemodule enables it so thatjetty.shcan wait for startup; this PR adds the same module to Solr's server dir, since Solr ships its own module set.STARTEDis written only afterServer.doStart()has returned. That method first starts the handlers, which runs Solr'sCoreContainerProviderandCoreContainer.load()to completion (ZooKeeper connect, live-node registration,_defaultconfigset upload), and then starts the connectors. So when the line appears, the node accepts and answers requests. A request sent earlier is not refused; it waits in the accept backlog. As before, replicas on a node in cloud mode may still be loading in the background.Notes for review
-Dsolr.pid.dirto the node, andsecurity.policygrants it that one file (${solr.pid.dir}/solr-${solr.port.listen}.state), not the directory: the default PID dir is the install'sbin.STARTEDeven if the CoreContainer failed to load, sostartsucceeds in that case, as it did before #5358.(pid=N)yet; #5348 resolves the PID and conflicts with this PR in the same few lines ofsolr.cmd.Tests: re-enables
SslTest.useDifferentHostnameWhenNotCheckingPeerNameandSslTest.useDifferentHostnameWithCurlResolve, and drops the_defaultconfigset wait inZkTest.SecurityManagerTest.stateFileInSeparatePidDirstarts a node with a PID dir outside the granted dirs, and fails if the node runs without a security manager on a JDK below 24. Full CATS suite passes on macOS;SslTest,ZkTestandBasicAuthTestpass on Windows.