potiuk opened a new pull request, #67511: URL: https://github.com/apache/airflow/pull/67511
`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](https://github.com/apache/airflow/blob/main/providers/google/src/airflow/providers/google/cloud/log/gcs_task_handler.py#L127) — silently truncating prior log history. Forensically important since the GCS upload is the durable record once the local log is rotated. Reported as F-012 in the [`apache/tooling-agents` L3 providers/google sweep `b1aec75`](https://github.com/apache/tooling-agents/issues/34). ## Change Distinguish the 404 case (safe: write the new content as a fresh blob — `no_log_found` already detects this) from non-404 read failures (transient: keep local logs, return `False`, let the next heartbeat retry). The 404 path is unchanged. ## Test plan - [x] Existing parametrised `test_write` (8 cases) updated 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`. All 8 parametrised cases pass via `breeze run pytest`. - [x] Local `uv run pytest` blocked by an unrelated DB-schema issue on the existing test fixture — verified clean via breeze. - [x] `prek run ruff` clean. --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Claude Code (Opus 4.7) Generated-by: Claude Code (Opus 4.7) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
