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

Show query execution status at page load if query is running #3409

Closed
wants to merge 1 commit into from

Conversation

washort
Copy link

@washort washort commented Feb 6, 2019

On initial page load, check Redis to see if a job is running for this query. If so, immediately show it as executing.

@ghost ghost assigned washort Feb 6, 2019
@ghost ghost added the in progress label Feb 6, 2019
@washort washort requested a review from jezdez February 6, 2019 22:39
Copy link
Member

@arikfr arikfr left a comment

Choose a reason for hiding this comment

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

Some issues in this PR:

  1. In the backend code: it's wasteful to lookup a job every time we serialize a query. 90% of the time it's going to be unused. The only time this might be useful is when loading a single query.

  2. While we load the job info when loading the query, it will only be used if the query had previous results. If it won't, it will be ignored.

  3. Some user just opening this query to see past results, won't be able to see them. This is bad UX, and can lead to more frustration than actually helping. One possible solution would be: when we detect there is an ongoing execution of the current query, we should show the user the option to "join" and wait for this execution instead of always opening it.

But before we're rushing into a solution it will be good to understand the problem we're trying to solve.

Thanks.

@washort
Copy link
Author

washort commented Feb 8, 2019

The general idea is to let users know when a query has already been started so that multiple runs of the same query aren't started by different users.

I assumed the performance impact of a redis lookup would be relatively small. Our current use case is to show the execution banner in the query view but we also considered a future version that shows execution status in the query list view as well.

I see your point about not being able to see cached results. Not sure how this should be handled.

@arikfr
Copy link
Member

arikfr commented Feb 8, 2019

The general idea is to let users know when a query has already been started so that multiple runs of the same query aren't started by different users.

Multiple users running the same query at the same time won't start multiple execution -- this is what the lock is for (the one you're using to lookup the job...).

Anyway. if that's the goal then maybe my suggestion of detecting when an execution of the current query is currently in progress, and showing a message about it, might be good enough.

I assumed the performance impact of a redis lookup would be relatively small.

While a single lookup is negligible N lookups accumulate and can introduce non negligible latency.

@arikfr
Copy link
Member

arikfr commented Jan 21, 2020

Hi,

(This is a template message, but I mean every word of it. Also you're welcome to reply)

Thank you for making this contribution. While we couldn't bring it to completion and merge, it's still very much appreciated. 🙇

In the past year the Redash code base gone under massive updates: on the backend we moved to Python 3 & RQ instead of Celery and on the frontend we replaced Angular with React. It's very likely this makes this PR irrelevant without significant changes. :-(

I'm closing this PR now. But if you're still interested in making it happen, let me know and I will reopen.

Thanks.

@arikfr arikfr closed this Jan 21, 2020
@jezdez
Copy link
Member

jezdez commented Jan 22, 2020

Hey @arikfr is this something you're still interested in? We're doing a review of our fork commits and this came up again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants