Skip to content
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

Fix infinite recursion on redact log #20039

Merged
merged 2 commits into from
Dec 7, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions airflow/utils/log/secrets_masker.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,13 @@ def _redact(self, item: "RedactableItem", name: Optional[str], depth: int) -> "R
else:
return item
# I think this should never happen, but it does not hurt to leave it just in case
# Well. It happened (see https://github.com/apache/airflow/issues/19816#issuecomment-983311373)
# but it caused infinite recursion, so we need to cast it to str first.
except Exception as e:
log.warning(
"Unable to redact %r, please report this via <https://github.com/apache/airflow/issues>. "
"Unable to redact %s, please report this via <https://github.com/apache/airflow/issues>. "
"Error was: %s: %s",
item,
item.repr(),
ashb marked this conversation as resolved.
Show resolved Hide resolved
type(e).__name__,
str(e),
)
Expand Down