Skip to content

Commit 9b701d5

Browse files
committed
chore: improve error message for timeout exceptions (#13883)
1 parent 845eda4 commit 9b701d5

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

airbyte-workload-launcher/src/main/kotlin/pods/KubePodClient.kt

+12-7
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import io.airbyte.workload.launcher.pods.factories.ConnectorPodFactory
3333
import io.airbyte.workload.launcher.pods.factories.OrchestratorPodFactory
3434
import io.airbyte.workload.launcher.pods.factories.ReplicationPodFactory
3535
import io.fabric8.kubernetes.api.model.Pod
36+
import io.fabric8.kubernetes.client.KubernetesClientTimeoutException
3637
import jakarta.inject.Named
3738
import jakarta.inject.Singleton
3839
import java.time.Duration
@@ -365,13 +366,17 @@ class KubePodClient(
365366
) {
366367
try {
367368
kubePodLauncher.waitForPodInitComplete(pod, POD_INIT_TIMEOUT_VALUE)
368-
} catch (e: TimeoutException) {
369-
ApmTraceUtils.addExceptionToTrace(e)
370-
throw KubeClientException(
371-
"$podLogLabel pod failed to init within allotted timeout.",
372-
e,
373-
KubeCommandType.WAIT_INIT,
374-
)
369+
} catch (e: Exception) {
370+
when (e) {
371+
is TimeoutException, is KubernetesClientTimeoutException -> {
372+
ApmTraceUtils.addExceptionToTrace(e)
373+
throw KubeClientException(
374+
"Unable to start the $podLogLabel pod. This may be due to insufficient system resources. Please check available resources and try again.",
375+
e,
376+
KubeCommandType.WAIT_INIT,
377+
)
378+
} else -> throw e
379+
}
375380
}
376381
}
377382

0 commit comments

Comments
 (0)