elastic/elasticsearch · warning · TestClustersException
Interrupted while waiting for ports files
Error message
Interrupted while waiting for ports files
What it means
Thrown by checkPortsFilesExistWithDelay when Thread.sleep(500) is interrupted while waiting for the http and transport ports files to appear. The method restores the interrupt flag (Thread.currentThread().interrupt()) before throwing, which is correct interrupt etiquette. This is a startup-readiness helper.
Source
Thrown at build-tools/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java:1724
private String id() {
return "node{" + path + ":" + name + "}";
}
@Input
List<Map<String, String>> getCredentials() {
return credentials;
}
private boolean checkPortsFilesExistWithDelay(TestClusterConfiguration node) {
if (Files.exists(httpPortsFile) && Files.exists(transportPortFile)) {
return true;
}
try {
Thread.sleep(500);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new TestClustersException("Interrupted while waiting for ports files", e);
}
return Files.exists(httpPortsFile) && Files.exists(transportPortFile);
}
@Internal
public boolean isHttpSslEnabled() {
return Boolean.parseBoolean(settings.getOrDefault("xpack.security.http.ssl.enabled", "false").toString());
}
void configureHttpWait(WaitForHttpResource wait) {
if (settings.containsKey("xpack.security.http.ssl.certificate")) {
wait.setServerCertificate(getConfigDir().resolve(settings.get("xpack.security.http.ssl.certificate").toString()).toFile());
} else {
if (settings.containsKey("xpack.security.http.ssl.keystore.path")) {
wait.setServerKeystoreFile(
getConfigDir().resolve(settings.get("xpack.security.http.ssl.keystore.path").toString()).toFile()
);
}View on GitHub (pinned to db6a809a66)
Solutions
- If user-initiated cancellation, ignore — the test framework will report the cancellation separately.
- If unexpected, check gradle daemon health (memory, timeout settings) for why the thread was interrupted.
- If the ports genuinely never appear, investigate the node startup itself (error 93/94 root cause) rather than this interrupt.
Defensive patterns
Strategy: try-catch
Try / catch
try {
Thread.sleep(500);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new TestClustersException("Interrupted while waiting for ports files", e);
} Prevention
- Treat this interrupt as benign if the build was cancelled.
- Investigate node startup root cause (errors 93/94) rather than this symptom.
When it happens
Trigger: A gradle task or framework interrupts the thread during the 500ms sleep between the two existence checks of httpPortsFile/transportPortFile. The first check returned false, so the method sleeps and re-checks; interruption during that sleep triggers the throw.
Common situations: Build cancellation (Ctrl-C), gradle daemon eviction, or a test-framework timeout interrupting the startup wait. Often benign when user-initiated.
Related errors
- Interrupted while waiting for {}
- Can not start {}, is not a directory: {}
- Failed to create working directory for {}, with: {}
- Can't run bin script: `{}` does not exist. Is this the distr
- Failed to set the keystore password for {}
AI-assisted analysis of elastic/elasticsearch@db6a809a66 (2026-08-12).
Data as JSON: /api/errors/bbe0fa79ad4052fa.
Report an issue: GitHub.