-
Notifications
You must be signed in to change notification settings - Fork 14.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move to watchtower 2.0.1 - Fixes Watchtower crash when logging empty line #19907
Conversation
- This version of watchtower contains patches that fixes apache#15279 where empty log lines would crash Watchtower.
@@ -81,7 +81,7 @@ def set_context(self, ti): | |||
self.handler = watchtower.CloudWatchLogHandler( | |||
log_group=self.log_group, | |||
stream_name=self._render_filename(ti, ti.try_number), | |||
boto3_session=self.hook.get_session(self.region_name), | |||
boto3_client=self.hook.get_conn(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Watchtower now expects a Boto3 client instead of a session, this was changed in this commit: kislyuk/watchtower@a623250
The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease. |
Overview
This version of watchtower contains patches (submitted by myself and Andrey the maintainer) that fixes #15279 where empty log lines would crash Watchtower.
Testing
I wrote a dag with the following benchmarks:
I detected no noticeable regression in task run time, and as expected the new watchtower version does not crash when logging an empty line.
Note: The logic, as Andrey wrote it, ignores empty log lines and emits a warning message (see snippet below). The warning messages could be a nuisance if you're logging empty lines frequently, and it is possible to remove them, but I think it's a also a good indicator to the user that their remote logs will look different than they expect due to the empty messages being filtered. Let me know what you folks think.
Example output from my empty line benchmark task:
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.