-
Notifications
You must be signed in to change notification settings - Fork 14.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: report with timeout chart #16674
fix: report with timeout chart #16674
Conversation
Codecov Report
@@ Coverage Diff @@
## master #16674 +/- ##
==========================================
- Coverage 76.90% 76.90% -0.01%
==========================================
Files 1005 1005
Lines 54007 54008 +1
Branches 7337 7337
==========================================
Hits 41536 41536
- Misses 12231 12232 +1
Partials 240 240
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@graceguo-supercat we're actually looking into getting more up-to-date data on the charts by always refreshing the data and not using cached results. I wonder, given this information if we could set a cache timeout on reports for something like 30 minutes and instead of erroring after 60 seconds either lengthening the timeout or retrying the dashboard after an error. It seems like we should deliver all of the charts to the users, and if we have to keep trying until the charts are all loaded, that should be ok, since it's an async operation anyway. WDYT? |
|
@eschutho regardless of the timeout strategy are you supportive of at least capturing the screenshot per the PR? |
I think this PR is an improvement, regardless of the strategy we choose. |
@@ -141,6 +141,7 @@ def get_screenshot( | |||
img = element.screenshot_as_png | |||
except TimeoutException: | |||
logger.warning("Selenium timed out requesting url %s", url, exc_info=True) | |||
img = element.screenshot_as_png |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it always possible to call element.screenshot_as_png
without raising when a TimeoutException
occurs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i guess it's webdriver raise TimeoutException right? i am not sure how to not raise it...
+1
you mean besides |
yes, definitely. This is an good win for now. |
that's what i need! I didn't realize these wait time already configurable. Thanks! |
Is 100 seconds with the data cached or uncached? If we set a configurable report cache buffer for example, and your longest query is at 30 seconds cached and 100 seconds uncached, and your total waits were 1 min, you could set the buffer for half an hour or so and the first time it loads it will fail and retry and be mostly cached. You should keep getting lower times until it it is all cached and you hit below the 60 sec mark. Basically I think cache-busting the reports is good but within configurable limits, depending on the needs of the organization. |
When did re-try happen? right after 1st fail or after cache expired? If i set schedule to send report at 7:00, and 1st try failed, did i get an email at 7:00? I think we probably should discuss cache/retry in its own PR or thread. This PR is to make sure sending out report even with chart timeout. |
Yes, that discussion isn't related to your pr.. we can continue in a different thread! 👍 |
SUMMARY
A user schedule may an email report for a dashboard in the future time. When webdriver takes screeshot of the dashboard, one or more of its charts may not well cached, and may take pretty long time to query. Current webdriver wait timeout is 60 seconds. If one of charts didn't get rendered after timeout, currently Superset will report an email with following error message but no screenshot of dashboard.
To most of dashboard report users, a report with a couple of timeout chart (showing spinner) is still acceptable, much better than an error message without report. Could we still send report with timeout chart? @dpgaspar @betodealmeida @eschutho
TESTING INSTRUCTIONS
CI and manual test