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

Allow to Cancel() query at any time #1174

Merged
merged 2 commits into from
Sep 6, 2018
Merged

Conversation

alourie
Copy link
Contributor

@alourie alourie commented Sep 6, 2018

Solving #1173

  • Add a Cancel() call to the ExecutableQuery interface
  • Add cancelQuery and cancelBatch fields
  • Initiate Query/Batch context/cancel functions
  • Implement Cancel() call by calling the cancelQuery/cancelBatch
    functions
  • Add TestCancel to verify that the query is being cancelled by the
    cancel call before it's finished.

Alex Lourie added 2 commits September 6, 2018 16:01
Solving apache#1173

* Add a Cancel() call to the RetryableQuery interface
* Add cancelQuery and cancelBatch fields
* Initiate Query/Batch context
* Implement Cancel() call by calling the cancelQuery/cancelBatch
functions
* Add TestCancel to verify that the query is being cancelled by the
cancel call before it's finished.

Signed-off-by: Alex Lourie <[email protected]>
* The Cancel() call moved from RetryableQuery to ExecutableQuery
* Simplify context and cancel functions initialisation
* Improve TestCancel with the following:
  * the test is now actually testing that the query was cancelled.
  * doesn't need "veryslow" server query, just using "timeout" is enough
  * using a waitgroup to cleanup after the test
  * cut the runtime to about 20ms, so elapsed times measure is not
  required

Signed-off-by: Alex Lourie <[email protected]>
@alourie
Copy link
Contributor Author

alourie commented Sep 6, 2018

This will be used in Speculative Query executions (#1083) to cancel the outstanding/other running queries when one has succeeded.

@Zariel Zariel merged commit 08a3a27 into apache:master Sep 6, 2018
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.

2 participants