Budget exhaustion and per-tile spinner timeouts in take_tiled_screenshot()
are customer-side chart-loading issues, not Superset system faults, so log
them at WARNING instead of ERROR -- consistent with the precedent set by
#38130 and #38441, which deliberately downgraded screenshot timeout logs
the same way. Genuine system faults (browser crash, uncaught Playwright
errors) remain at the existing exception/ERROR level, unchanged.
Thread an optional log_context string through the screenshot call chain
(ChartScreenshot/DashboardScreenshot.get_screenshot -> WebDriverProxy
implementations -> take_tiled_screenshot) so every log line this PR adds
or touches can be traced back to its run: the report execution id on the
report path, or the thumbnail cache key on the thumbnail path (no new
plumbing invented there -- cache_key was already in scope).
Also add a per-tile DEBUG timing line (spinner wait vs. animation wait)
and richer WARNING diagnostics (tile index, tiles captured so far, elapsed
vs. budget) so a slow dashboard can be profiled and a timeout diagnosed
from logs alone.
Co-Authored-By: Claude <noreply@anthropic.com>
Cumulative per-tile spinner/animation waits in take_tiled_screenshot() could
exceed the Celery task_time_limit on dashboards with many tiles, causing the
worker to be SIGKILLed mid-capture (SoftTimeLimitExceeded) instead of the
report failing cleanly. Track elapsed wall time across the operation, cap
each tile's wait at what remains of a fixed budget, and raise before the
budget runs out so the report errors and notifies owners rather than
silently degrading or crashing.
Co-Authored-By: Claude <noreply@anthropic.com>