Skip to content

Conversation

@4meta5
Copy link
Contributor

@4meta5 4meta5 commented Apr 29, 2024

Closes #871

  • configurable per network via root gated extrinsic set_shard_task_limit
  • if new_limit < current_limit, the shard will not be assigned any more tasks until assigned less than new_limit
  • number of assigned tasks per shard does not include completed tasks
  • testing

@4meta5 4meta5 added ready-for-review PR author(s) done with coding and reviewer[s] can start and removed WIP labels May 1, 2024
@4meta5 4meta5 requested a review from dvc94ch May 1, 2024 18:26
@4meta5 4meta5 added this to the Milestone Q2 2024 milestone May 1, 2024
Copy link
Contributor

@dvc94ch dvc94ch left a comment

Choose a reason for hiding this comment

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

lgtm

if capacity.is_zero() {
// no new tasks assigned if capacity reached or exceeded
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

we already handle the zero case later no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We take(capacity) below after filtering for tasks that are assignable. I think returning early is better if capacity is 0 rather than going through all the tasks just to take 0 of them afterwards.

@4meta5 4meta5 merged commit c9eb3e2 into development May 17, 2024
@4meta5 4meta5 deleted the amar-configurable-assigned-task-limit-per-shard branch May 17, 2024 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request priority: high ready-for-review PR author(s) done with coding and reviewer[s] can start status: confirmed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make number of assigned tasks configurable

3 participants