aminghadersohi opened a new pull request, #38130: URL: https://github.com/apache/superset/pull/38130
### SUMMARY Selenium timeout exceptions during screenshot generation are expected operational behavior (slow-loading dashboards, network latency, etc.) and not actual server errors. These were being logged at ERROR level via `logger.exception()`, creating significant noise in log aggregators like Datadog. **Changes:** - `webdriver.py`: Change `logger.exception()` to `logger.warning(..., exc_info=True)` for all three timeout scenarios (page load, dashboard draw, chart load) - `webdriver.py`: Fix bare `except:` clause to use `except Exception:` - `webdriver.py`: Reorder outer except blocks so specific exceptions (`TimeoutException`, `StaleElementReferenceException`, `WebDriverException`) are caught before the generic `Exception` handler — previously these were unreachable dead code - `dashboards/api.py`: Downgrade `logger.error()` to `logger.warning()` in the thumbnail endpoint's catch-all handler that returns 404 (inconsistent to log ERROR for a 404 response) ### BEFORE/AFTER SCREENSHOTS OR COVERAGE URL N/A - logging level changes only, no UI impact. ### TESTING INSTRUCTIONS 1. Trigger a dashboard thumbnail generation for a dashboard that takes a long time to load 2. Check that selenium timeout messages are logged at WARNING level instead of ERROR 3. Verify that the `ScreenshotImageNotAvailableException` still returns 404 properly 4. Unit tests: `pytest tests/unit_tests/utils/webdriver_test.py` (16/17 pass - the 1 failure is pre-existing in Playwright test, unrelated to these changes) ### ADDITIONAL INFORMATION - These changes directly address Datadog `[remove]` exclusion filters for selenium timeout errors - The outer except block reordering fixes a bug where `except Exception` caught everything before the more specific handlers, making them dead code - `logger.warning(..., exc_info=True)` preserves the full stack trace for debugging while correctly classifying the severity 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
