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

Batch operation rate limit #502

Closed

Conversation

stephanos
Copy link
Contributor

@stephanos stephanos commented Mar 20, 2024

ℹ️ This is a redo of #366 that was reverted since it was merged prematurely.

What was changed

Added a new flag --rps to the 4 batch operations.

Note that although batch-reset is a batch operation, it performs its work locally instead of on the server - so the flag does not apply here.

Why?

To fix temporalio/temporal#4926.

Checklist

  1. Closes OSS-1681

  2. How was this tested:

  1. Any docs updates needed? see Batch operation rate limit documentation#2413

@@ -83,8 +83,10 @@ func ListBatchJobs(c *cli.Context) error {
// BatchTerminate terminate a list of workflows
func BatchTerminate(c *cli.Context) error {
operator := common.GetCurrentUserFromEnv()
rps := float32(c.Float64(common.FlagRPS))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

AFAICT, the CLI library doesn't have a built-in Float32 flag, so we need to downcast here. Which is fine; the required precision we expect here will most likely never be more than 2 decimals.

FlagQueryTerminate = "Terminate Workflow Executions with given List Filter."
FlagEventIDDefinition = "The Event Id for any Event after WorkflowTaskStarted you want to reset to (exclusive). It can be WorkflowTaskCompleted, WorkflowTaskFailed or others."
FlagQueryResetBatch = "Visibility Query of Search Attributes describing the Workflow Executions to reset. See https://docs.temporal.io/docs/tctl/workflow/list#--query."
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To align it with the other flags, I changed this into FlagQueryReset and standardized the text.

@stephanos stephanos closed this Mar 22, 2024
@cretz cretz deleted the revert-378-revert-366-batch-operation-rate-limit branch April 29, 2024 16:28
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.

Add a rate limit option for batch operations
1 participant