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

Perform cleanup on job timeouts #4681

Merged
merged 5 commits into from
Feb 26, 2020
Merged

Conversation

rauchy
Copy link
Contributor

@rauchy rauchy commented Feb 24, 2020

What type of PR is this? (check all applicable)

  • Refactor
  • Bug Fix

Description

After moving query executions to RQ, job timeouts resulted in JobTimeoutException being raised. Since some query runners perform cleanup when executions are being cancelled by users, the same cleanup should be performed when jobs time out. (i.e. cancel the database query).

While going through the different query runners, I've noticed that query cancellation code is very repetitive, and sometimes just unnecessary and only returns a "Query cancelled by user." error message. I've modified these to raise the exception and have the serializer handle that automatically.

One caveat is that previously, when cancelling a query, the user would see "Query cancelled by user", and now it will also include an "Error running query" prefix.

image

This is due to me reusing the error status code for the serialized job, we could easily work around this by introducing a "cancelled" status call ("failed" doesn't feel right).

Related Tickets & Documents

#4307 #4629

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

@rauchy rauchy requested a review from arikfr February 24, 2020 22:34
@arikfr
Copy link
Member

arikfr commented Feb 25, 2020

One caveat is that previously, when cancelling a query, the user would see "Query cancelled by user", and now it will also include an "Error running query" prefix.

How come there was no prefix before? I thought we were always reporting this as an error?

@rauchy
Copy link
Contributor Author

rauchy commented Feb 25, 2020

My mistake, it did show with the prefix before.

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.

💯

@rauchy rauchy merged commit 9790b07 into master Feb 26, 2020
@rauchy rauchy deleted the perform-cleanup-on-job-timeouts branch February 26, 2020 11:25
@rauchy rauchy mentioned this pull request Mar 1, 2020
1 task
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.

None yet

2 participants