Lee-W commented on code in PR #76381:
URL: https://github.com/apache/airflow/pull/76381#discussion_r4640316479


##########
providers/common/ai/docs/durable_execution.rst:
##########
@@ -171,6 +171,18 @@ Without the option, the task fails with:
 
     ValueError: Durable execution on Airflow before 3.3 needs [common.ai] 
durable_cache_path to be set, to say where its journal is kept. Example: 
durable_cache_path = file:///tmp/airflow_durable_cache
 
+For S3, the IAM role must also have ``s3:ListBucket`` permission on the 
bucket, in
+addition to permissions to read, write, and delete journal objects. Without
+``s3:ListBucket``, S3 returns ``403 Access Denied`` instead of ``404 Not 
Found``
+when the journal does not exist. This is treated as a storage read failure, so 
even
+the first task attempt fails. Read failures stop the attempt to avoid repeating
+completed LLM calls or tool operations when an existing journal cannot be read.
+
+A corrupt journal also fails the task attempt and is left unchanged. Retrying 
alone

Review Comment:
   A read failure re-raises the original `OSError` and follows the task’s 
retries, while a corrupt journal raises `DurableJournalError`, which as far as 
I can tell from reading the code is not retried, and neither this page nor the 
changelog note says so. Could this paragraph say that Airflow will not retry a 
corrupt journal, so it has to be fixed first, and could the changelog note and 
the read-failure paragraph above say the same split?



##########
providers/common/ai/src/airflow/providers/common/ai/durable/storage.py:
##########
@@ -151,8 +167,8 @@ def delete_steps(self, keys: Iterable[str]) -> None:
                 self._write(json.dumps(cache))
             else:
                 self._get_path().unlink()
-                self._cache = None
+                self._cache = {}

Review Comment:
   Next to this `_cache = {}` change, delete_steps still calls 
`self._load_cache()` before the try, although the comment says the method "must 
never raise". No caller reaches it with an unloaded cache now, but if one did, 
a corrupt journal would now fail an already-succeeded task with a non-retried 
`DurableJournalError`. Could `_load_cache()` move inside the try, or the 
comment say callers must have loaded the cache?



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