ashb commented on code in PR #67652:
URL: https://github.com/apache/airflow/pull/67652#discussion_r3319440152


##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/utils/pod_manager.py:
##########
@@ -1108,12 +1117,22 @@ def parse_log_line(line: str) -> tuple[DateTime | None, 
str]:
     :param line: k8s log line
     :return: timestamp and log message
     """
-    timestamp, sep, message = line.strip().partition(" ")
+    # Strip only the trailing newline so an empty container line (which kubelet
+    # streams back as "<rfc3339-ts> \n" under ``timestamps=True``) keeps the
+    # separator space and is recognised as a real log line, not a continuation
+    # of the previous one (#36571).
+    stripped = line.rstrip("\n")
+    timestamp, sep, message = stripped.partition(" ")
     if not sep:
-        return None, line
+        # No space found: the whole line might still be a bare timestamp from
+        # an empty container write.
+        try:
+            return cast("DateTime", pendulum.parse(stripped)), ""
+        except (ParserError, ValueError):
+            return None, line

Review Comment:
   Couldn't those be
   
   ```suggestion
           timestamp = stripped
   ```
   



-- 
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]

Reply via email to