#86961·airbyte

PodSweeper skips pods forever when both status.conditions and status.startTime are unset (stuck Pending pods never cleaned up)

Author: RafaelAvigliano-DevopsCreated Sep 24, 2026Updated Sep 24, 2026
Labelscommunityautoteamteam/use

What happened?

PodSweeper (in airbyte-workload-launcher) is responsible for cleaning up leftover airbyte=job-pod pods according to RUNNING_TTL_MINUTES / SUCCEEDED_TTL_MINUTES / UNSUCCESSFUL_TTL_MINUTES.

For pods that never got scheduled (e.g. stuck Pending due to insufficient node CPU/memory), pod.status.startTime is always null (it's only set once a container starts). The sweeper falls back to pod.status.conditions.firstOrNull()?.lastTransitionTime:

https://github.com/airbytehq/airbyte-platform/blob/main/airbyte-workload-launcher/src/main/kotlin/PodSweeper.kt#L103-L119

kotlin
val transitionTime =
    pod.status
      ?.conditions
      ?.firstOrNull() // conditions[0] if it exists
      ?.lastTransitionTime
val startTime = pod.status?.startTime

val podInstant: Instant? =
    when {
      !transitionTime.isNullOrBlank() -> parseKubeDate(transitionTime)
      !startTime.isNullOrBlank() -> parseKubeDate(startTime)
      else -> null
    }

if (podInstant == null) {
    // Could not parse any valid date, skip
    logger.info { "Skipping pod ${pod.metadata?.name} - no valid transition/start time found." }
    continue
}

If pod.status.conditions is empty/null (observed in practice for pods that never got past scheduling) and startTime is null, podInstant is null and the pod is skipped — permanently. No TTL is ever applied to it, so it leaks forever unless someone deletes it manually.

Separately, even when conditions is non-empty, using conditions.firstOrNull() (index 0, not filtered by condition type) is fragile: status.conditions ordering is not a documented guarantee of the Kubernetes API, so which condition ends up at index 0 (and therefore which lastTransitionTime gets used) can vary.

What did you expect to happen?

Every airbyte=job-pod pod should eventually be reachable by a TTL cutoff, regardless of whether it ever got scheduled. pod.metadata.creationTimestamp is always present and immutable for any pod object, so it would be a more reliable primary/ultimate-fallback signal than status.conditions[0] for pods that never transitioned out of Pending.

Steps to reproduce

  1. Configure a node pool with less CPU than JOB_MAIN_CONTAINER_CPU_REQUEST * 3 (source + destination + orchestrator containers) allows for even a single concurrent sync.
  2. Trigger several syncs concurrently so some replication-job-* pods fail to schedule (FailedScheduling: Insufficient cpu) and stay Pending.
  3. Wait past UNSUCCESSFUL_TTL_MINUTES (default from the chart: 120 minutes).
  4. Observe: some of those Pending pods are cleaned up by the sweeper (their sole PodScheduled=False condition carries a valid lastTransitionTime), but others are skipped indefinitely — in our case pods reached 170+ minutes of age with PodScheduled condition still present, yet never got swept until we deleted them manually. Correlated log line: "Skipping pod <name> - no valid transition/start time found.".

Platform Version

Airbyte OSS 1.8.2 / Helm chart airbyte 1.8.3

Are you willing to submit a PR?

No, but happy to share more logs/context if useful. Filing this from a production troubleshooting session where a cluster ran out of CPU headroom, causing a backlog of Pending sync pods that never got cleaned up by the sweeper — we worked around it with an external CronJob that sweeps airbyte=job-pod pods based on metadata.creationTimestamp instead.