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] add checks for stopped queries #8097

Merged
merged 1 commit into from
Aug 23, 2019

Conversation

serenajiang
Copy link
Contributor

CATEGORY

Choose one

  • Bug Fix
  • Enhancement (new features, refinement)
  • Refactor
  • Add tests
  • Build / Development Environment
  • Documentation

SUMMARY

When a user tries to stop a query, very occasionally, the action fails and the query still runs to completion. The issue isn't user-facing, but errors in the backend show that there is some kind of lock wait timeout issue.

Unknown if it is possible to completely prevent these, and the issue isn't really user-facing, but I added some tweaks to hopefully prevent a few of these conflicts.

  • Add commit() after setting the initial query status to RUNNING
  • Check if the query has stopped before running each statement. Exit if query has stopped.
  • (Unrelated) Removed line 281 which (afaik) doesn't do anything

TEST PLAN

Tox passes.

I didn't write a test because it is pretty hard to reproduce this error - seems like a rare timing thing. These changes are mostly for safety and shouldn't affect behavior of anything.

REVIEWERS

@etr2460

@codecov-io
Copy link

Codecov Report

Merging #8097 into master will decrease coverage by 0.02%.
The diff coverage is 75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8097      +/-   ##
==========================================
- Coverage   65.83%   65.81%   -0.03%     
==========================================
  Files         486      486              
  Lines       22921    22924       +3     
  Branches     2521     2521              
==========================================
- Hits        15090    15087       -3     
- Misses       7700     7706       +6     
  Partials      131      131
Impacted Files Coverage Δ
superset/sql_lab.py 76.84% <75%> (-0.17%) ⬇️
superset/db_engine_specs/postgres.py 79.31% <0%> (-17.25%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0d76fc7...a767560. Read the comment docs.

Copy link
Member

@mistercrunch mistercrunch left a comment

Choose a reason for hiding this comment

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

LGTM

@mistercrunch mistercrunch merged commit e6956f8 into apache:master Aug 23, 2019
serenajiang added a commit to airbnb/superset-fork that referenced this pull request Aug 26, 2019
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.35.0 labels Feb 28, 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 🚢 0.35.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants