Add remote log upload support for callback subprocesses#66379
Open
seanghaeli wants to merge 2 commits intoapache:mainfrom
Open
Add remote log upload support for callback subprocesses#66379seanghaeli wants to merge 2 commits intoapache:mainfrom
seanghaeli wants to merge 2 commits intoapache:mainfrom
Conversation
Enable callback logs (deadline alerts, SLA notifications, etc.) to be uploaded to remote storage (S3, GCS, etc.) so they are visible in the Airflow UI when remote logging is configured. Key change: make `ti` optional in `RemoteLogIO.upload()` protocol and `upload_to_remote()` since callbacks don't have a task instance. The 7 providers that ignore `ti` (S3, GCS, CloudWatch, WASB, OSS, HDFS, Alibaba) work immediately. Elasticsearch and OpenSearch use `ti` for log ID rendering and will need a follow-up to handle the `ti=None` case — until then, callback log upload failures for those providers are caught and logged without affecting callback execution. - Make `ti` optional (`RuntimeTI | None = None`) in `RemoteLogIO.upload()` protocol and `upload_to_remote()` - Add `_upload_logs()` to `CallbackSubprocess.wait()`, delegating to `upload_to_remote` with error handling that swallows failures - Wire up `_remote_logging_conn(client)` in `_configure_logging()` so remote log handler processors are initialized during logging setup - Move logging setup inside `_ensure_client()` context in `supervise_callback()` so the client is available for `_configure_logging()`
…gging path Update Elasticsearch and OpenSearch provider upload() signatures to match the RemoteLogIO protocol (ti: RuntimeTI | None = None). Both providers now handle ti=None gracefully by logging a warning and returning early, since they require task instance metadata for log ID rendering. Also adds a test for the "remote logging not configured" code path in CallbackSubprocess._upload_logs().
Contributor
Author
|
@ferruzzi @ramitkataria your reviews would be much appreciated |
This was referenced May 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enable callback logs (deadline alerts, SLA notifications, etc.) to be uploaded to remote storage (S3, GCS, etc.) so they are visible in the Airflow UI when remote logging is configured.
Key change: make
tioptional inRemoteLogIO.upload()protocol andupload_to_remote()since callbacks don't have a task instance. The 7 providers that ignoreti(S3, GCS, CloudWatch, WASB, OSS, HDFS, Alibaba) work immediately. Elasticsearch and OpenSearch now handle theti=Nonecase gracefully (log a warning and skip upload since they need TI for log ID rendering).Changes
tioptional (RuntimeTI | None = None) inRemoteLogIO.upload()protocol andupload_to_remote()upload()signatures to match protocol_upload_logs()toCallbackSubprocess.wait(), delegating toupload_to_remotewith error handling_remote_logging_conn(client)in_configure_logging()so remote log handler processors are initializedRelated