-
Notifications
You must be signed in to change notification settings - Fork 111
[CLI] Various improvements to batch cancel/kill and co. #3943
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
base: main
Are you sure you want to change the base?
Conversation
|
Tested with 2milion invocaitons, and it does work... Takes a bit, but works ok-ish. Also with the progress bars now, it seems like it's doing something! |
muhamadazmy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @slinkydeveloper for this PR and sorry it took too long to review. I left couple of comments below.
| ); | ||
| return Ok(()); | ||
| } | ||
| render_simple_invocation_list(&invocations, DEFAULT_BATCH_INVOCATIONS_OPERATION_LIMIT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| render_simple_invocation_list(&invocations, DEFAULT_BATCH_INVOCATIONS_OPERATION_LIMIT); | |
| render_simple_invocation_list(&invocations, ops.limit); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was intentional, let me tell you my thinking:
- You want to kill/cancel/whatev maaaany invocations
- Printing all those IDs has a cost, ain't cheap, and you can see it actually takes time here in this command.
- Are you, as a user, actually gonna read them all?! Probably not.
- And even if you want to, when you have such a large output, your terminal emulator will start chopping the output anyway!
So it boils down to: I have this opts.limit here in case you see the query failing/crashing because it's too big, or taking too long, but my operation here was legit in the first place, I actually want to do that big operation killing all Greeter requests. But I don't really care what i'm killing anyway, i know it's gazillion of invocations anyway.
Do you think this makes sense?
Also invocations.len() will be equal to ops.limit anyway, so this change itself won't have effect, right?
| }; | ||
|
|
||
| render_simple_invocation_list(&invocations); | ||
| render_simple_invocation_list(&invocations, DEFAULT_BATCH_INVOCATIONS_OPERATION_LIMIT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| render_simple_invocation_list(&invocations, DEFAULT_BATCH_INVOCATIONS_OPERATION_LIMIT); | |
| render_simple_invocation_list(&invocations, opts.limit); |
| }; | ||
|
|
||
| render_simple_invocation_list(&invocations); | ||
| render_simple_invocation_list(&invocations, DEFAULT_BATCH_INVOCATIONS_OPERATION_LIMIT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
| }; | ||
|
|
||
| render_simple_invocation_list(&invocations); | ||
| render_simple_invocation_list(&invocations, DEFAULT_BATCH_INVOCATIONS_OPERATION_LIMIT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here also
…g the concurrency.
* Use the limited concurrency map to execute concurrently the admin api commands. Limiting concurrency to 500 seems to be the way to not make it fail 🤷 There's also the mistery of 1011... * Don't print twice the invocations we're going to kill, there's no need. Just print the failed ones, if any. Same for pause/resume, etc. * Limit the amount of output too. This is a problem when killing 2milion invocations... * Add progress bar when reading the invocations * Add another progress bar when cancelling them
b45c8fb to
49d7938
Compare
Mitigates #3857