mobuchowski commented on code in PR #64843:
URL: https://github.com/apache/airflow/pull/64843#discussion_r3045987628
##########
providers/openlineage/src/airflow/providers/openlineage/plugins/listener.py:
##########
@@ -790,8 +790,21 @@ def _fork_execute(self, callable, callable_name: str):
if not AIRFLOW_V_3_0_PLUS:
configure_orm(disable_connection_pool=True)
self.log.debug("Executing OpenLineage process - %s - pid %s",
callable_name, os.getpid())
- callable()
- self.log.debug("Process with current pid finishes after %s",
callable_name)
+ try:
+ callable()
+ self.log.debug("Process with current pid finishes after %s",
callable_name)
+ except Exception:
+ self.log.warning(
+ "OpenLineage %s process failed. This has no impact on
actual task execution status.",
+ callable_name,
+ exc_info=True,
+ )
+ finally:
+ # os._exit(0) bypasses Python's atexit/stdio flush. Explicitly
shut down
+ # logging so buffered records (including any warnings above)
are flushed
+ # before the process exits. Without this, the final log lines
are silently
+ # dropped, making failures invisible.
+ logging.shutdown()
Review Comment:
We're on our own process there, but will doublecheck.
--
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]