shashbha14 opened a new pull request, #63176:
URL: https://github.com/apache/airflow/pull/63176
When running KubernetesPodOperator in deferrable mode, pod logs that contain
non-UTF-8 bytes (truncated multi-byte sequences, tqdm progress bars, binary
output, etc.) caused a UnicodeDecodeError to propagate up from
'AsyncKubernetesHook.read_logs()'. Since only 'HTTPError' was being caught,
this bubbled up as an unhandled exception and crashed the task entirely.
The fix catches 'UnicodeDecodeError' in 'read_logs', logs a warning with
the
exception details, and returns an empty list for that interval. The next
polling cycle will attempt to fetch logs again, so nothing is lost except
one log window — much better than the whole task failing.
Also added a unit test that mocks 'read_namespaced_pod_log' to raise
'UnicodeDecodeError' and asserts the method returns '[]' without raising.
Fixes #63173
--
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]