Web UI task logging with CloudWatch has a 60 second time delay #45554
Labels
area:core
area:logging
area:UI
Related to UI/UX. For Frontend Developers.
kind:bug
This is a clearly a bug
needs-triage
label for new issues that we didn't triage yet
provider:amazon-aws
AWS/Amazon - related issues
Apache Airflow version
Other Airflow 2 version (please specify below)
If "Other Airflow 2 version" selected, which one?
2.10.1
What happened?
When using CloudWatch logging there seems to be a 60 second time delay between the logging output updating. Please see the video below and observe:
Please skip ahead in the video as most of it is static!
Recording.2025-01-10.134419.mp4
As a second minor point, you can also see that grouping now longer works with the logs read from CloudWatch. However, this doesn't concern me as much.
What you think should happen instead?
I'm not sure if I have configured something incorrectly, but I expected the same behaviour as local logging, i.e. tailing of the log file.
I struggled to find the default behaviour documented, but what I expect to happen was that Airflow would use the local logs if they were available and only use the remote logs if no local logs were found.
I found this logic in previous documentation (<2.0), although this may now be outdated:
Can you confirm that this is the expected behaviour and what is in the video above is a bug?
Alternatively, I can see in the browser that a request is made every second to update the logs, and I can confirm that the logs are only being written to CloudWatch every 60 seconds or when the task is complete.
Is this expected behaviour? or should logs be written to cloudwatch at a higher rate?
If the behaviour in the video is actually what is expected, I would like to suggest one of the following options as we need a <60 second refresh window in our logging setup:
local_logging_prefer = True
).remote_logging_refresh_period = 60
).Let me know your thoughts.
How to reproduce
The remote logging config was copied from here:
The demo DAG used in the video above prints to logging every 10 seconds and is as follows:
Operating System
NAME="Ubuntu" VERSION="20.04.6 LTS (Focal Fossa)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 20.04.6 LTS" VERSION_ID="20.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=focal UBUNTU_CODENAME=focal
Versions of Apache Airflow Providers
Deployment
Other Docker-based deployment
Deployment details
No response
Anything else?
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: