@@ -33,6 +33,7 @@ import io.airbyte.workload.launcher.pods.factories.ConnectorPodFactory
33
33
import io.airbyte.workload.launcher.pods.factories.OrchestratorPodFactory
34
34
import io.airbyte.workload.launcher.pods.factories.ReplicationPodFactory
35
35
import io.fabric8.kubernetes.api.model.Pod
36
+ import io.fabric8.kubernetes.client.KubernetesClientTimeoutException
36
37
import jakarta.inject.Named
37
38
import jakarta.inject.Singleton
38
39
import java.time.Duration
@@ -365,13 +366,17 @@ class KubePodClient(
365
366
) {
366
367
try {
367
368
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
+ }
375
380
}
376
381
}
377
382
0 commit comments