SIGN IN SIGN UP
apache / airflow UNCLAIMED

Apache Airflow - A platform to programmatically author, schedule, and monitor workflows

0 0 267 Python

Fail closed in GCS log handler when existing-log read fails (#67511)

* google: fail closed in GCS log handler when existing-log read fails

``GCSRemoteLogIO.write`` reads the existing blob, appends the new log
content, then uploads. When ``download_as_bytes()`` failed for a
reason other than "object does not exist" (transient GCS outage, IAM
glitch, network blip), the read exception was caught, a warning was
logged, and execution fell through to upload **only the new content**
— silently truncating prior log history.

Distinguish the 404 case (safe: write the new content as a fresh
blob) from non-404 read failures (transient: keep local logs, return
False, let the next heartbeat retry). The 404 path is unchanged.

Updates ``test_write`` to reflect the new fail-closed contract: when
``download_as_bytes`` raises a non-404 error the handler now returns
``False`` and does not call ``upload_from_string``.

* Update compat test for fail-closed GCS log handler contract

The pre-existing 2.11-compat test asserted the old fail-open contract
(download fails, upload with truncated content). Align it with the new
fail-closed behavior: download attempted, no upload.
J
Jarek Potiuk committed
e55cffc4175567e2519341035c52b7672411ea49
Parent: 8da8502
Committed by GitHub <noreply@github.com> on 5/29/2026, 1:32:42 PM