Skip to content

Commit

Permalink
Enhance startup timeout message (elastic#110763)
Browse files Browse the repository at this point in the history
Includes the setting name as well as its value, and also add a link to
the relevant troubleshooting docs. Also reinstates a thread interrupt
flag that could technically get lost here otherwise.
  • Loading branch information
DaveCTurner authored Jul 12, 2024
1 parent 560d404 commit be6583d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion server/src/main/java/org/elasticsearch/node/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.cluster.version.CompatibilityVersions;
import org.elasticsearch.common.ReferenceDocs;
import org.elasticsearch.common.StopWatch;
import org.elasticsearch.common.component.Lifecycle;
import org.elasticsearch.common.component.LifecycleComponent;
Expand Down Expand Up @@ -396,14 +397,20 @@ public void onClusterServiceClose() {

@Override
public void onTimeout(TimeValue timeout) {
logger.warn("timed out while waiting for initial discovery state - timeout: {}", initialStateTimeout);
logger.warn(
"timed out after [{}={}] while waiting for initial discovery state; for troubleshooting guidance see [{}]",
INITIAL_STATE_TIMEOUT_SETTING.getKey(),
initialStateTimeout,
ReferenceDocs.DISCOVERY_TROUBLESHOOTING
);
latch.countDown();
}
}, state -> state.nodes().getMasterNodeId() != null, initialStateTimeout);

try {
latch.await();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ElasticsearchTimeoutException("Interrupted while waiting for initial discovery state");
}
}
Expand Down

0 comments on commit be6583d

Please sign in to comment.