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

Have throttled worker always wait throttleDelay between work calls #229989

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

lramos15
Copy link
Member

@lramos15 lramos15 commented Sep 27, 2024

Consider the following case, maxWorkChunkSize of 1 and a throttleDelay of 1000ms. The maxBufferedWork doesn't matter here.

  1. Queue a unit at 0ms. It immediately executes as there is nothing in the throttler
  2. Queue a unit at 500ms. It immediately executes again as there is nothing in the throttler.

This seems wrong as I don't want my work items to execute without a minimum 1000ms gap in between them. Instead even if the queue is empty, the throttled worker should ensure that the second queue task must wait 500ms before executing so it's been 1000ms since the last unit of work.

This does modify the text behavior slightly, so I am happy to make this an option on the worker options or something, but I was surprised when the worker did not work out of the box like this

@lramos15 lramos15 self-assigned this Sep 27, 2024
@lramos15 lramos15 enabled auto-merge (squash) September 27, 2024 17:34
@vs-code-engineering vs-code-engineering bot added this to the October 2024 milestone Sep 27, 2024
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