villebro commented on code in PR #43316:
URL: https://github.com/apache/superset/pull/43316#discussion_r3831486861


##########
superset/async_events/async_query_manager.py:
##########
@@ -445,11 +502,12 @@ def cancel_job(self, job_id: str, channel_id: str, 
user_id: Optional[int]) -> No
         # key still exists (``xx``): if the job finished and cleared its record
         # between the read above and here, don't recreate a stale record or
         # revoke a task that is already gone — report it as not found instead.
-        flagged = self._cache.set(
+        flagged = CoordinationService.set_value(
             key,
             json.dumps({**record, "cancelled": True}),
-            ex=self._jwt_expiration_seconds or None,
-            xx=True,
+            ttl=self._jwt_expiration_seconds or None,
+            if_present=True,
+            backend=self._gaq_backend,
         )

Review Comment:
   This cancellation protocol (registry + XX write + revoke + publish) predates 
this PR, it came in with #42305 and is unchanged here; this PR only swaps the 
backend plumbing beneath it. So it's out of scope for this change. Happy to 
look at it separately, though the exactly-one-terminal-event guarantee is 
best-effort and a hardened fix would need an atomic transition.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to