jedcunningham commented on code in PR #46501:
URL: https://github.com/apache/airflow/pull/46501#discussion_r1944201310


##########
airflow/dag_processing/bundles/base.py:
##########
@@ -112,3 +125,22 @@ def view_url(self, version: str | None = None) -> str | 
None:
         :param version: Version to view
         :return: URL to view the bundle
         """
+
+    @contextmanager
+    def lock(self):
+        if self._locked:
+            yield
+            return
+
+        lock_dir_path = self._dag_bundle_root_storage_path / "locks"
+        lock_dir_path.mkdir(parents=True, exist_ok=True)
+        lock_file_path = lock_dir_path / f"{self.name}.lock"
+        with open(lock_file_path, "w") as lock_file:

Review Comment:
   Also found this:
   
   > On at least some systems, LOCK_EX can only be used if the file descriptor 
refers to a file opened for writing.
   
   We really only want exclusive locks for this purpose too.



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