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

Log traceback only on DEBUG for KPO logs read interruption #22595

Merged
merged 2 commits into from
Mar 29, 2022
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
8 changes: 6 additions & 2 deletions airflow/providers/cncf/kubernetes/utils/pod_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,13 @@ def consume_logs(*, since_time: Optional[DateTime] = None, follow: bool = True)
for line in logs:
timestamp, message = self.parse_log_line(line.decode('utf-8'))
self.log.info(message)
except BaseHTTPError: # Catches errors like ProtocolError(TimeoutError).
except BaseHTTPError:
self.log.warning(
'Failed to read logs for pod %s',
"Reading of logs was interrupted, likely due to a connection issue. "
"Will retry momentarily.",
Copy link
Member

@potiuk potiuk Mar 29, 2022

Choose a reason for hiding this comment

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

Should we at least add the error message - not traceback - here in parenthesis (without it, It feels completely blind guessing).

I think that would strike the right balance

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok take look

)
self.log.debug(
"Traceback for interrupted logs read for pod %r",
pod.metadata.name,
exc_info=True,
)
Expand Down