Skip to content

Conversation

@o-nikolas
Copy link
Contributor

@o-nikolas o-nikolas commented Apr 3, 2025

There were three main issues:

  1. A circular loop that eventually fails due to call depth exceeded. This is because the handler was lazily initted during the first log emission. But when the handler is created some code down stream tries to log, and since there is no handler yet (because we're in the middle of creating it), it tries to create another one, and we were spinning ad infinitum.
  2. The stream name is not set on read, because we don't call set_context anywhere in the SDK path, and the processor doesn't have access to the TI anyway (which is used for the stream name). So a 0 byte stream name was being used and was causing a failure in Watchtower.
  3. read is also failing because it is using the relative_path as the stream name, which is almost right, but the name isn't sanitized (there are some characters that cloudwatch doesn't allow in a stream name). set_context used to sanitize the name and set it, but it isn't called in the SDK path.

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an 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 a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

There were three main issues:

1) A circular loop that eventually fails due to call depth exceeded. This is because the handler was lazily initted during the first log emission. But when the handler is created some code down stream tries to log, and since there is no handler yet (because we're in the middle of creating it), it tries to create another one, and we were spinning ad infinitum.
2) The stream name is not set on read, because we don't call set_context anywhere in the SDK path, and the processor doesn't have access to the TI anyway (which is used for the stream name). So a 0 byte stream name was being used and was causing a failure in Watchtower.
3) read is also failing because it is using the relative_path as the stream name, which is almost right,  but the name isn't sanitized (there are some characters that cloudwatch doesn't allow in a stream name). set_context used to sanitize the name and set it, but it isn't called in the SDK path.
Copy link
Member

@ashb ashb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this

@ashb ashb merged commit 5ca62b8 into apache:main Apr 4, 2025
70 checks passed
nailo2c pushed a commit to nailo2c/airflow that referenced this pull request Apr 4, 2025
There were three main issues:

1) A circular loop that eventually fails due to call depth exceeded. This is because the handler was lazily initted during the first log emission. But when the handler is created some code down stream tries to log, and since there is no handler yet (because we're in the middle of creating it), it tries to create another one, and we were spinning ad infinitum.
2) The stream name is not set on read, because we don't call set_context anywhere in the SDK path, and the processor doesn't have access to the TI anyway (which is used for the stream name). So a 0 byte stream name was being used and was causing a failure in Watchtower.
3) read is also failing because it is using the relative_path as the stream name, which is almost right,  but the name isn't sanitized (there are some characters that cloudwatch doesn't allow in a stream name). set_context used to sanitize the name and set it, but it isn't called in the SDK path.
diogotrodrigues pushed a commit to diogotrodrigues/airflow that referenced this pull request Apr 6, 2025
There were three main issues:

1) A circular loop that eventually fails due to call depth exceeded. This is because the handler was lazily initted during the first log emission. But when the handler is created some code down stream tries to log, and since there is no handler yet (because we're in the middle of creating it), it tries to create another one, and we were spinning ad infinitum.
2) The stream name is not set on read, because we don't call set_context anywhere in the SDK path, and the processor doesn't have access to the TI anyway (which is used for the stream name). So a 0 byte stream name was being used and was causing a failure in Watchtower.
3) read is also failing because it is using the relative_path as the stream name, which is almost right,  but the name isn't sanitized (there are some characters that cloudwatch doesn't allow in a stream name). set_context used to sanitize the name and set it, but it isn't called in the SDK path.
simonprydden pushed a commit to simonprydden/airflow that referenced this pull request Apr 8, 2025
There were three main issues:

1) A circular loop that eventually fails due to call depth exceeded. This is because the handler was lazily initted during the first log emission. But when the handler is created some code down stream tries to log, and since there is no handler yet (because we're in the middle of creating it), it tries to create another one, and we were spinning ad infinitum.
2) The stream name is not set on read, because we don't call set_context anywhere in the SDK path, and the processor doesn't have access to the TI anyway (which is used for the stream name). So a 0 byte stream name was being used and was causing a failure in Watchtower.
3) read is also failing because it is using the relative_path as the stream name, which is almost right,  but the name isn't sanitized (there are some characters that cloudwatch doesn't allow in a stream name). set_context used to sanitize the name and set it, but it isn't called in the SDK path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants