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

Add a handler to kill a query #1304

Merged
merged 5 commits into from
Sep 27, 2024

Conversation

akoshelev
Copy link
Collaborator

@akoshelev akoshelev commented Sep 22, 2024

In our testing with external parties, it became quite evident that bouncing helpers if query fails is far from having good experience for people who run the test. We need to have an ability to kill queries that failed on one or more helper and restart the runs.

This change does exactly that - adding a /query_id/kill handler that will respond with immediately aborting the task that runs an IPA query.

How to terminate a query?

if helper address is helper.com, one can terminate a query by sending a POST request to

http(s)://helper.com/query/0/kill

For local testing it can be done easily with curl

curl -X POST http://localhost:3002/query/0/kill

if query is killed successfully, the following response is provided by the helper

{"query_id":"0","status":"killed"}

In our testing with external parties, it became quite evident that
bouncing helpers if query fails is far from having good experience
for people who run the test. We need to have an ability to kill queries
that failed on one or more helper and restart the runs.

This change does exactly that - adding a `/query_id/kill` handler
that will respond with immediately aborting the task that runs
an IPA query.
@richajaindce
Copy link
Contributor

Thanks for adding this!! It's going to be really helpful. Can you also add an example of how to run this.

Also, (n00b qn) I am supposing we would get a query id whenever a query is run to call this API?

@akoshelev
Copy link
Collaborator Author

Thanks for adding this!! It's going to be really helpful. Can you also add an example of how to run this.

Also, (n00b qn) I am supposing we would get a query id whenever a query is run to call this API?

good point! I've updated the overview section to show how to terminate a query. Please let me know if something is not clear

Copy link

codecov bot commented Sep 22, 2024

Codecov Report

Attention: Patch coverage is 97.04641% with 7 lines in your changes missing coverage. Please review.

Project coverage is 93.50%. Comparing base (f329272) to head (2443420).
Report is 37 commits behind head on main.

Files with missing lines Patch % Lines
ipa-core/src/query/processor.rs 95.83% 3 Missing ⚠️
ipa-core/src/app.rs 0.00% 2 Missing ⚠️
ipa-core/src/net/transport.rs 92.59% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1304      +/-   ##
==========================================
+ Coverage   93.41%   93.50%   +0.08%     
==========================================
  Files         208      208              
  Lines       33798    33690     -108     
==========================================
- Hits        31574    31502      -72     
+ Misses       2224     2188      -36     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@eriktaubeneck eriktaubeneck left a comment

Choose a reason for hiding this comment

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

thank you! this is awesome.

it would be worthwhile to also add a subcommand to the report collector binary that calls this on all helpers in a network file, but I can take that as a work item in follow up.

ipa-core/src/net/http_serde.rs Outdated Show resolved Hide resolved
@akoshelev
Copy link
Collaborator Author

it would be worthwhile to also add a subcommand to the report collector binary that calls this on all helpers in a network file, but I can take that as a work item in follow up.

Great idea, this can totally be a separate PR to keep things manageable

@akoshelev akoshelev merged commit 5115bb0 into private-attribution:main Sep 27, 2024
12 checks passed
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