sadpandajoe commented on code in PR #43805:
URL: https://github.com/apache/superset/pull/43805#discussion_r3928359816
##########
superset/tasks/export_dashboard_excel.py:
##########
@@ -98,6 +117,25 @@ def export_lock_params(user_id: int, dashboard_id: int) ->
dict[str, int]:
return {"user_id": user_id, "dashboard_id": dashboard_id}
+def guest_lock_slot(guest_token: GuestToken | None) -> int:
+ """A stable per-guest lock slot derived from the token's identity, so
+ concurrent guests on the same dashboard throttle independently instead of
+ all sharing slot 0 (where the second guest's export is refused with no
+ job id and no email fallback). Anonymous requesters (no token) share 0.
+ """
+ if not guest_token:
+ return 0
+ user = guest_token.get("user") or {}
+ resources = guest_token.get("resources") or []
+ fingerprint = json.dumps(
Review Comment:
This fingerprint omits `rls_rules`, which is what distinguishes embedded
guests sharing a dashboard when `username` is absent or shared. Those users
still collide here, and the second export receives a 202 without a job id or
email fallback. Could the lock identity include the RLS claims as well?
--
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]