Skip to content

Conversation

@potiuk
Copy link
Member

@potiuk potiuk commented Feb 12, 2026

There are some obscure cases where exception might point to itself in cause/context - this PR protects against it.

Changed name to include cause as well.

Initially implemented as a fix to v2-11-test in #61254 - enhanced with the case of removal of too-deep exceptions rather than not-redacting it (and replacing it with sentinel exception explaining that reminder of the stack trace has been removed.


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@potiuk potiuk requested a review from ashb February 12, 2026 00:39
@potiuk potiuk changed the title Fix recursion depth error in _redact_exception_with_context [v2-11-test] Fix recursion depth error in _redact_exception_with_context Feb 12, 2026
@potiuk potiuk added this to the Airflow 2.11.1 milestone Feb 12, 2026
There are some obscure cases where exception might point to itself
in cause/context - this PR protects against it.

Changed name to include cause as well.

Initially implemented as a fix to v2-11-test in apache#61254 - enhanced
with the case of removal of too-deep exceptions rather than
not-redacting it (and replacing it with sentinel exception explaining
that reminder of the stack trace has been removed.

Co-authored-by: Anton Nitochkin <nitochkin@google.com>

(cherry picked from commit (1533ecf)
def test_redacts_from_print(self, capsys):
# Without redacting, password is printed.
print(p)
print(PASSWORD)

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High test

This expression logs
sensitive data (password)
as clear text.
# With context manager, password is redacted.
with contextlib.redirect_stdout(RedactedIO()):
print(p)
print(PASSWORD)

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High test

This expression logs
sensitive data (password)
as clear text.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant