potiuk commented on code in PR #34127:
URL: https://github.com/apache/airflow/pull/34127#discussion_r1323743308
##########
airflow/providers/cncf/kubernetes/utils/pod_manager.py:
##########
@@ -388,7 +388,7 @@ def fetch_container_logs(
before=before_log(self.log, logging.INFO),
)
def consume_logs(
- *, since_time: DateTime | None = None, follow: bool = True,
termination_timeout: int = 120
+ *, logs: PodLogsConsumer
Review Comment:
> It's an internal method in "fetch_container_logs" - it can't be used from
outside :)
But my point is different @hussein-awala ... the modified method is an
internal method of another method. If you reveal what's before, you will see
something lke that:
```
def fetch_container_logs( # <-- THIS IS THE "external" method that
"consume_logs" is defined insde of
self,
pod: V1Pod,
container_name: str,
*,
follow=False,
since_time: DateTime | None = None,
post_termination_timeout: int = 120,
) -> PodLoggingStatus:
"""
Follows the logs of container and streams to airflow logging.
Returns when container exits.
Between when the pod starts and logs being available, there might be
a delay due to CSR not approved
and signed yet. In such situation, ApiException is thrown. This is
why we are retrying on this
specific exception.
"""
@tenacity.retry(
retry=tenacity.retry_if_exception_type(ApiException),
stop=tenacity.stop_after_attempt(10),
wait=tenacity.wait_fixed(1),
before=before_log(self.log, logging.INFO),
)
def consume_logs( # <---- THIS IS THE METHOD WE MODIFY (it's
internal method of "fetch_container_logs"
*,
since_time: DateTime | None = None,
follow: bool = True,
termination_timeout: int = 120,
logs: PodLogsConsumer | None,
) -> tuple[DateTime | None, PodLogsConsumer | None]:
```
There is no way you can call "consume_logs" from outside. It only makes
sense if you call it as part of "fetch_consume_logs". So this is really not
even an interface.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]