Skip to content

Conversation

@potiuk
Copy link
Member

@potiuk potiuk commented Dec 4, 2021

When redact warning log on "unredactable" item is printed, the
log entered an infinite recursion, because the item was attempted
to be redacted again in the log.

This PR converts the item to str() - in the worst case the str
converstion will fail and raise exception - but this will be about
right - but it will not attempt to redact the item again.

Fixes: #19816


^ 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.

@potiuk potiuk requested review from ashb and uranusjr December 4, 2021 17:33
@potiuk potiuk force-pushed the fix-infinite-recursion-in-redact branch 3 times, most recently from cd1464a to 8e03c8e Compare December 4, 2021 22:40
@potiuk potiuk force-pushed the fix-infinite-recursion-in-redact branch 2 times, most recently from 82a2aec to 933c0b1 Compare December 5, 2021 15:33
@potiuk
Copy link
Member Author

potiuk commented Dec 5, 2021

Ok. That one should be ready to merge - the only failing test is another test_scheduler_job flakiness that is already addressed in #19860

@potiuk potiuk requested a review from kaxil December 5, 2021 21:46
When redact warning log on "unredactable" item is printed, the
log entered an infinite recursion, because the item was attempted
to be redacted again in the log.

This PR converts the item to str() - in the worst case the str
converstion will fail and raise exception - but this will be about
right - but it will not attempt to redact the item again.

Fixes: apache#19816
@potiuk potiuk force-pushed the fix-infinite-recursion-in-redact branch from 933c0b1 to 91a30f1 Compare December 6, 2021 20:28
@potiuk
Copy link
Member Author

potiuk commented Dec 6, 2021

Shalll we ?

Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
@github-actions
Copy link

github-actions bot commented Dec 7, 2021

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.

@github-actions github-actions bot added the full tests needed We need to run full set of tests for this PR to merge label Dec 7, 2021
@potiuk potiuk merged commit f441833 into apache:main Dec 7, 2021
@potiuk potiuk deleted the fix-infinite-recursion-in-redact branch December 7, 2021 21:40
@jedcunningham jedcunningham added this to the Airflow 2.2.3 milestone Dec 7, 2021
jedcunningham pushed a commit that referenced this pull request Dec 7, 2021
* Fix infinite recursion on redact log

When redact warning log on "unredactable" item is printed, the
log entered an infinite recursion, because the item was attempted
to be redacted again in the log.

This PR converts the item to str() - in the worst case the str
converstion will fail and raise exception - but this will be about
right - but it will not attempt to redact the item again.

Fixes: #19816

* Update airflow/utils/log/secrets_masker.py

(cherry picked from commit f441833)
@jedcunningham jedcunningham added the type:bug-fix Changelog: Bug Fixes label Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:logging full tests needed We need to run full set of tests for this PR to merge type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

logging error

5 participants