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

Worker::run_one panics #90

Open
rustworthy opened this issue Nov 30, 2024 · 1 comment
Open

Worker::run_one panics #90

rustworthy opened this issue Nov 30, 2024 · 1 comment

Comments

@rustworthy
Copy link
Collaborator

In Worker::run_one , it's possible to specify ID of a worker that does not exists. It's also possible to build a "workerless" worker, i.e. only coordinator without any workers, with WorkerBuilder::workers(0). Both cases are demonstrated here.

We may also want to introduce a dedicated error variant and check if the worker ID (index) they are specifying in within the range OR just disallow picking a worker in Worker::run_one.

As for a "workerless" worker, we may want to substitute WorkerBuilder::workers for WorkerBuilder::extra_workers so that it's a at least a coordinator plus one worker plus extra workers (which will default to 0).

@rustworthy
Copy link
Collaborator Author

As a quick fix would be to take a 'worker_id mod workers_count' in 'Worker::run_one' to prevent out of range indexing, but I think one of the approaches from above could go into release 0.14.

Other things that may be batched are:

  • dependencies bump (there is a PR that's on hold for now)
  • we may want 'Job::retry' to be an Option for consistency (see 'Failure::retry_count')

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

No branches or pull requests

1 participant