kyungjunleeme commented on code in PR #53958:
URL: https://github.com/apache/airflow/pull/53958#discussion_r2245065480
##########
airflow-core/src/airflow/exceptions.py:
##########
@@ -511,3 +511,35 @@ def __str__(self):
class UnknownExecutorException(ValueError):
"""Raised when an attempt is made to load an executor which is not
configured."""
+
+
+class AirflowFileLockAcquireException(AirflowException):
+ """Raised when a file lock cannot be acquired (e.g., via `fcntl.flock`
with LOCK_SH or LOCK_EX)."""
+
+ def __init__(self, file_path: str | None, original_exception: Exception |
None = None):
+ super().__init__()
+ self.file_path = file_path
+ self.original_exception = original_exception
Review Comment:
You’re right — since raise ... from e automatically preserves the original
exception in __cause__ and Python will include it in the traceback, explicitly
logging or storing the original exception again isn’t necessary.
Thanks for pointing that out — I’ll go ahead and simplify the code
accordingly.
--
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]