Skip to content

Conversation

@slinkydeveloper
Copy link
Contributor

Mitigates #3857

@slinkydeveloper slinkydeveloper changed the title Add a limit to the batch cancel/kill and co. [WIP] Add a limit to the batch cancel/kill and co. Nov 4, 2025
@slinkydeveloper
Copy link
Contributor Author

slinkydeveloper commented Nov 4, 2025

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!

@slinkydeveloper slinkydeveloper changed the title [WIP] Add a limit to the batch cancel/kill and co. Add a limit to the batch cancel/kill and co. Nov 4, 2025
@slinkydeveloper slinkydeveloper changed the title Add a limit to the batch cancel/kill and co. [CLI] Add a limit to the batch cancel/kill and co. Nov 4, 2025
@slinkydeveloper slinkydeveloper changed the title [CLI] Add a limit to the batch cancel/kill and co. [CLI] Various improvements to batch cancel/kill and co. Nov 5, 2025
Copy link
Contributor

@muhamadazmy muhamadazmy left a 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);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
render_simple_invocation_list(&invocations, DEFAULT_BATCH_INVOCATIONS_OPERATION_LIMIT);
render_simple_invocation_list(&invocations, ops.limit);

Copy link
Contributor Author

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);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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);
Copy link
Contributor

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);
Copy link
Contributor

Choose a reason for hiding this comment

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

Here also

* 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
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