Skip to content

Commit 71a46bc

Browse files
committed
Fix sourcery-ai review comments
1 parent 9783894 commit 71a46bc

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

gateway-ha/src/main/java/io/trino/gateway/ha/router/BaseRoutingManager.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import io.trino.gateway.ha.config.ProxyBackendConfiguration;
2626
import io.trino.gateway.ha.config.RoutingConfiguration;
2727
import jakarta.annotation.Nullable;
28+
import jakarta.annotation.PreDestroy;
2829
import jakarta.ws.rs.HttpMethod;
2930

3031
import java.net.HttpURLConnection;
@@ -278,6 +279,16 @@ public String load(String queryId)
278279
private boolean isBackendHealthy(String backendId)
279280
{
280281
TrinoStatus status = backendToStatus.getOrDefault(backendId, TrinoStatus.UNKNOWN);
282+
if (status == TrinoStatus.UNKNOWN) {
283+
log.warn("Backend health for '%s' is UNKNOWN and not tracked.", backendId);
284+
return false;
285+
}
281286
return status == TrinoStatus.HEALTHY;
282287
}
288+
289+
@PreDestroy
290+
public void shutdown()
291+
{
292+
executorService.shutdownNow();
293+
}
283294
}

0 commit comments

Comments
 (0)