You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "itej13 (via GitHub)" <gi...@apache.org> on 2026/06/27 12:01:08 UTC
[PR] Close S3 download_file handle after download or failure [airflow]
itej13 opened a new pull request, #69084:
URL: https://github.com/apache/airflow/pull/69084
`S3Hook.download_file` opened a local file (or a `NamedTemporaryFile` with `delete=False`), streamed the object into it, and returned the path **without ever closing the handle** — relying on garbage collection to release the descriptor. On a download error the handle leaked the same way.
Closing it in a `finally` releases the descriptor on every path (success and failure) while keeping the downloaded file on disk for the caller. Adds a regression test asserting the handle is closed when the download raises.
related: #69077
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes — Claude Code (Opus 4.8)
Generated-by: Claude Code (Opus 4.8) 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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Close S3 download_file handle after download or failure [airflow]
Posted by "shahar1 (via GitHub)" <gi...@apache.org>.
shahar1 merged PR #69084:
URL: https://github.com/apache/airflow/pull/69084
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org