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

Release tasks early #253

Merged
merged 2 commits into from
Jun 26, 2021
Merged

Release tasks early #253

merged 2 commits into from
Jun 26, 2021

Conversation

hannahhoward
Copy link
Contributor

Goals

Improve scaling by allowing workers to run in the background over parallelism limit for storage tasks once data transfer is finished

Implementation

Rather than n-workers queues in parallel, always kick off a seperate go routine per task.

We basically have two modes of popping tasks:

  • track total tasks running
  • below parallism limit, pop tasks and run them up to parallelism limit, using a existing delay if there are no tasks to pop
  • above parallelism limit, pop no tasks until a task is released by a worker, either by the worker calling a release callback, or by the task finishing (also has nice side effect of not attempting a pop unless there is the ability to run it immediately)

Also:

  • setup the whole engine so it's dependencies are mockable
  • use a timer mock library (normal timer in production)
  • setup tests to test the timing (these ended up being pretty complicated and I'm not totally sure the value of them... but...)

@hannahhoward hannahhoward force-pushed the feat/convert-to-queue branch from 238817f to b78bd4f Compare June 25, 2021 20:25
Setup queue so tasks can be released by worker before being totally finished. setup storage to
release when data transfer is complete
@hannahhoward hannahhoward force-pushed the feat/convert-to-queue branch 7 times, most recently from 16215a4 to f30c68a Compare June 25, 2021 23:31
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