dhiaayachi / temporal

Temporal service
https://docs.temporal.io
MIT License
0 stars 0 forks source link

Do not consume rate limit token on invalid tasks #80

Open dhiaayachi opened 2 months ago

dhiaayachi commented 2 months ago

When setting maxTaskQueueActivitiesPerSecond to enable rate limit on task queue, the token is consumed when task is attempted to be delivered. However, the task could be invalid (expired or workflow already closed), which lead to waste of rate limit token.

We should change this to only consume token when task is delivered.

dhiaayachi commented 2 months ago

Thank you for reporting this issue! I understand your concern about the rate limit token being consumed when a task is attempted to be delivered, even if it's invalid.

Currently, Temporal's rate limiting mechanism consumes a token when a task is attempted to be delivered, regardless of its validity. This behavior is documented in the Rate Limiting section of the Temporal documentation.

We are aware of this potential for wasted tokens and are actively working on a solution that will consume tokens only when tasks are successfully delivered.

In the meantime, you can consider using a workaround such as:

We appreciate your feedback and will keep you updated on the progress of this issue.

dhiaayachi commented 2 months ago

Thank you for reporting this issue!

We understand that the rate limit token is currently consumed when a task is attempted to be delivered, even if the task is invalid. This can lead to wasted tokens.

We are currently working on improving this behavior by only consuming tokens when the task is successfully delivered.

In the meantime, you can consider the following workarounds:

We will update you on the progress of the fix.

dhiaayachi commented 2 months ago

Thank you for reporting this issue! I understand that the rate limit token is currently being consumed when a task is attempted to be delivered, even if the task is invalid. This can lead to wasted rate limit tokens.

We are currently investigating this issue and working on a solution. In the meantime, you can work around this by:

We apologize for any inconvenience this may cause. We will keep you updated on the progress of this issue.