seanghaeli commented on code in PR #76571:
URL: https://github.com/apache/airflow/pull/76571#discussion_r4519116287
##########
task-sdk/src/airflow/sdk/api/client.py:
##########
@@ -1181,8 +1184,34 @@ def __init__(self, client: Client):
self.client = client
def run(self, callback_id: uuid.UUID) -> None:
- """Exchange the single-use callback token for an execution token."""
- self.client.patch(f"callbacks/{callback_id}/run")
+ """
+ Exchange the single-use callback token for an execution token.
+
+ The server uses up the token once it gets the request, so only retry
when the request never
+ reached it, and give a slow server longer to answer.
+ """
+ try:
Review Comment:
I like the idea of a per-attempt nonce you proposed @uranusjr . It was
raised in the issue I filed #76735 that it would also be good to cover the case
of a worker dying after the exchange, which I think can be handled well by
re-dispatching the callback with a fresh token. I think that approach has the
potential to cover all related follow-up concerns, but it needs a way to detect
dead workers and has to be safe against running the callback twice. We may be
able to go with the re-dispatching approach instead of the per-attempt nonce
approach, but it may turn out that both are desirable in different cases. I
will continue to think about this within the issue I filed.
If we all agree that this PR is the right shape for a 3.4.1 stopgap, let's
resolve this thread and move follow-up discussion into issue #76735
@amoghrajesh @uranusjr
--
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]