Skip to content
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(sqllab): Add threshold for checking inactive queries #24536

Merged

Conversation

justinpark
Copy link
Member

SUMMARY

There's a issue that triggered preview query has gone occasionally. It is because the CLEAR_INACTIVE_QUERIES trigger in a 2s batch time but some queries can be added at the time to verify the inactive queries.
This commit adds the threshold to check the inactive queries to fix the problem.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

After:

after--flushing-preview-queries.mov

Before:

before--flushing-preview-queries.mov

TESTING INSTRUCTIONS

Try to choose tables to make a preview query and open new tab for additional request for preview queries

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@codecov
Copy link

codecov bot commented Jun 28, 2023

Codecov Report

Merging #24536 (19da472) into master (e20b695) will decrease coverage by 0.14%.
The diff coverage is 94.44%.

❗ Current head 19da472 differs from pull request most recent head b34afea. Consider uploading reports for the commit b34afea to get more accurate results

@@            Coverage Diff             @@
##           master   #24536      +/-   ##
==========================================
- Coverage   69.06%   68.93%   -0.14%     
==========================================
  Files        1901     1903       +2     
  Lines       74019    74027       +8     
  Branches     8116     8118       +2     
==========================================
- Hits        51121    51027      -94     
- Misses      20787    20889     +102     
  Partials     2111     2111              
Flag Coverage Δ
hive ?
javascript 55.74% <92.30%> (+0.03%) ⬆️
presto ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
.../plugins/plugin-chart-echarts/src/BoxPlot/index.ts 50.00% <ø> (ø)
...d/plugins/plugin-chart-echarts/src/Funnel/index.ts 50.00% <ø> (ø)
...nd/plugins/plugin-chart-echarts/src/Gauge/index.ts 50.00% <ø> (ø)
...nd/plugins/plugin-chart-echarts/src/Graph/index.ts 50.00% <ø> (ø)
.../plugin-chart-echarts/src/MixedTimeseries/index.ts 25.00% <ø> (ø)
...tend/plugins/plugin-chart-echarts/src/Pie/index.ts 50.00% <ø> (ø)
...nd/plugins/plugin-chart-echarts/src/Radar/index.ts 50.00% <ø> (ø)
...plugins/plugin-chart-echarts/src/Sunburst/index.ts 50.00% <ø> (ø)
.../plugin-chart-echarts/src/Timeseries/Area/index.ts 33.33% <ø> (ø)
...-chart-echarts/src/Timeseries/Regular/Bar/index.ts 33.33% <ø> (ø)
... and 23 more

... and 8 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@@ -201,8 +201,8 @@ export function estimateQueryCost(queryEditor) {
};
}

export function clearInactiveQueries() {
return { type: CLEAR_INACTIVE_QUERIES };
export function clearInactiveQueries(interval) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this function being called with an interval?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I pushed the missing part.

Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@justinpark justinpark merged commit 8ba0b81 into apache:master Jun 29, 2023
26 checks passed
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.0.0 labels Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/XS 🚢 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants