-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
[AIRFLOW-6522] Clear log file to fix duplication in S3TaskHandler #7120
[AIRFLOW-6522] Clear log file to fix duplication in S3TaskHandler #7120
Conversation
The same task instance (including try number) can be run on a worker when using a sensor in "reschedule" mode. Accordingly, this clears the local log file when re-initializing the logger so that the old log lines aren't uploaded again when the logger is closed.
a040930
to
1fc4738
Compare
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.
Trying to think if there are any edge cases to this (such as cases where the upload fails and we might loose the log?)
Can't think of any immediate ones, so LGTM.
The other option I considered was downloading the existing log from S3 into the file first (i.e. on initialization of the logger). If that succeeds, it can just overwrite with the local file. If it fails, it can use the existing append technique. Not sure your thoughts on that @ashb |
Awesome work, congrats on your first merged pull request! |
… in S3TaskHandler (#7120) The same task instance (including try number) can be run on a worker when using a sensor in "reschedule" mode. Accordingly, this clears the local log file when re-initializing the logger so that the old log lines aren't uploaded again when the logger is closed. (cherry picked from commit 88608ca)
… in S3TaskHandler (#7120) The same task instance (including try number) can be run on a worker when using a sensor in "reschedule" mode. Accordingly, this clears the local log file when re-initializing the logger so that the old log lines aren't uploaded again when the logger is closed. (cherry picked from commit 88608ca)
… in S3TaskHandler (#7120) The same task instance (including try number) can be run on a worker when using a sensor in "reschedule" mode. Accordingly, this clears the local log file when re-initializing the logger so that the old log lines aren't uploaded again when the logger is closed. (cherry picked from commit 88608ca)
… in S3TaskHandler (#7120) The same task instance (including try number) can be run on a worker when using a sensor in "reschedule" mode. Accordingly, this clears the local log file when re-initializing the logger so that the old log lines aren't uploaded again when the logger is closed. (cherry picked from commit 88608ca)
… in S3TaskHandler (apache#7120) The same task instance (including try number) can be run on a worker when using a sensor in "reschedule" mode. Accordingly, this clears the local log file when re-initializing the logger so that the old log lines aren't uploaded again when the logger is closed.
While here add a `files/` dir to the module. This allows the subdirectories to be called in the ansible patch module itself because it will search relative to this path. Actual patch: Taken from: apache/airflow#7120 Related to: https://issues.apache.org/jira/browse/AIRFLOW-6522
The same task instance (including try number) can be run on a worker
when using a sensor in "reschedule" mode. This PR clears the
local log file when re-initializing the logger so that the old log
lines aren't uploaded again when the logger is closed on subsequent runs.
Issue link: AIRFLOW-6522
[AIRFLOW-NNNN]
. AIRFLOW-NNNN = JIRA ID** For document-only changes commit message can start with
[AIRFLOW-XXXX]
.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.
Read the Pull Request Guidelines for more information.