gabotorresruiz commented on code in PR #43805:
URL: https://github.com/apache/superset/pull/43805#discussion_r3982197652
##########
superset/tasks/export_dashboard_excel.py:
##########
@@ -486,28 +635,34 @@ def export_dashboard_excel(
dashboard_title=dashboard_title,
download_url=download_url,
requested_at=requested_at,
- expires_at=expires_at,
+ # Stored naive-local to match is_expired(); the
email
+ # labels its timestamps "UTC", so convert for
display.
+ expires_at=expires_at.astimezone(timezone.utc),
ttl_seconds=ttl,
errored=errored,
),
)
except Exception: # pylint: disable=broad-except
- # The file is already in S3; a send failure should not
trigger
+ # The file is already uploaded; a send failure should not
trigger
# a misleading failure email.
logger.exception("Failed to send export success email")
except SoftTimeLimitExceeded:
logger.warning("Dashboard excel export %s timed out", job_id)
- _send_failure_email(user, dashboard_title, requested_at)
+ _handle_export_failure(user, dashboard_title, requested_at, job_id,
ttl)
raise
except Exception:
logger.exception("Dashboard excel export %s failed", job_id)
- _send_failure_email(user, dashboard_title, requested_at)
+ _handle_export_failure(user, dashboard_title, requested_at, job_id,
ttl)
raise
finally:
try:
ReleaseDistributedLock(
Review Comment:
Fixed. The API now threads its acquisition token into the task, and the task
releases with `token=lock_token`, so the release is master's
compare-and-delete: a TTL-expired lock reacquired by another export is left
untouched instead of blindly deleted. The enqueue-failure release path passes
the token too. Covered by unit and integration tests.
--
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]