-
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
[Task] add NonCachingRotatingFileHanlder for worker task #41064
Conversation
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
|
Are you sure this change is going to be backwards compatible? |
the new added parameters all have default value, should not break the existed init process for FileTaskHandler About the running logic: NonCachingRotatingFileHandler -> RotatingFileHandler -> BaseRotatingHandler -> FileHandler NonCachingFileHandler -> FileHandler In the BaseRotatingHandler, the code will check if it needs to do the rollover.
In the RotatingFileHandler, the rolling over check is based on if self.maxBytes > 0.
since the default maxBytes for this change is set to 0, so the call to the BaseRotatingHandler.emit() will directly call the logging.FileHandler.emit(self, record). It should be the same as we directly call the NonCachingFileHandler.emit() |
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.
LGTM
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
Cool! |
You can see the detail in #40880
Currently, we do not have any worker log disk isolation, and a bug in a dag can write a 10Gb + file, which can cause the cluster out of service.
This PR change the NonCachingFileHandler -> NonCachingRotatingFileHandler in FileTaskHandler, and users can limit the log rotate size for a task.