You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/07/10 23:11:38 UTC
[GitHub] [airflow] mdediana edited a comment on issue #9083: Links to Stackdriver in WebUI
mdediana edited a comment on issue #9083:
URL: https://github.com/apache/airflow/issues/9083#issuecomment-656932920
@mik-laj I ran into a recursion issue in `StackdriverTaskHandler` which I'm trying to figure out. This is how it happens:
`emit` calls `_transport`
https://github.com/apache/airflow/blob/3cc5756d04c7d3fd14b71e9ec6f5f906d5a24212/airflow/providers/google/cloud/log/stackdriver_task_handler.py#L140
which calls `_client`
https://github.com/apache/airflow/blob/3cc5756d04c7d3fd14b71e9ec6f5f906d5a24212/airflow/providers/google/cloud/log/stackdriver_task_handler.py#L120
which calls `get_credentials_and_project_id`
https://github.com/apache/airflow/blob/3cc5756d04c7d3fd14b71e9ec6f5f906d5a24212/airflow/providers/google/cloud/log/stackdriver_task_handler.py#L107
which calls `log.info`
https://github.com/apache/airflow/blob/3cc5756d04c7d3fd14b71e9ec6f5f906d5a24212/airflow/providers/google/cloud/utils/credentials_provider.py#L211
which apparently starts it all over again and then it breaks because maximum recursion depth is reached.
If I understand this correctly, the problem is that we are calling `logging.info` before initialization has finished, so a new initialization starts and so on.
I tried two things which prevent the error from happening, my plan is to investigate it further tomorrow and fix it. The two things:
- Removing the `log.info` call from `get_credentials_and_project_id`
- Instead of lazily initializing `client` on first `emit`, do it eagerly in `__init__` (i.e., convert the `cached_property` into a `property`)
Does it all make sense? If so, the second sounds like the right thing to do, what do you think?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org