kacpermuda commented on code in PR #67901:
URL: https://github.com/apache/airflow/pull/67901#discussion_r3342425334


##########
providers/openlineage/src/airflow/providers/openlineage/plugins/listener.py:
##########
@@ -834,7 +836,17 @@ def _terminate_with_wait(self, process: psutil.Process):
 
     def _fork_execute(self, callable, callable_name: str):
         self.log.debug("Will fork to execute OpenLineage process.")
-        pid = os.fork()
+        with warnings.catch_warnings():
+            # On Python 3.12+, os.fork() in a multi-threaded process emits a
+            # DeprecationWarning.  The fork here is intentional and the child
+            # takes precautions (ORM reconfiguration, os._exit) so the warning
+            # is safe to suppress.
+            warnings.filterwarnings(
+                "ignore",
+                message=".*use of fork\\(\\) may lead to deadlocks in the 
child",
+                category=DeprecationWarning,
+            )

Review Comment:
   Yes, I'd use silencing as a last resort here. We should probably look into 
possible workaround so that the code does not raise this warning in the first 
place. cc @I-am-Uchenna , if you'd like to work on this, I'd suggest this way 
forward.
   
   cc @mobuchowski 



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