potiuk commented on code in PR #66450:
URL: https://github.com/apache/airflow/pull/66450#discussion_r3214236023


##########
airflow-core/src/airflow/utils/log/log_stream_accumulator.py:
##########
@@ -31,6 +33,24 @@
         StructuredLogStream,
     )
 
+logger = logging.getLogger(__name__)
+
+
+def _safe_remove(path: str) -> None:
+    """
+    Remove path, swallowing missing-file errors and logging others.
+
+    Module-level rather than a method so weakref.finalize can hold it
+    without retaining a strong reference to the owning accumulator (which
+    would defeat the backstop).
+    """
+    try:
+        os.remove(path)
+    except FileNotFoundError:
+        pass
+    except OSError as exc:
+        logger.debug("LogStreamAccumulator: could not remove temp file %s: 
%s", path, exc)

Review Comment:
   One more comment @dheerajturaga  -> you merged it fast :) ... But can you 
turn that one in a warning? It should not be debug IMHO



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