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

Prefetch not working properly #299

Open
somehowchris opened this issue Feb 17, 2022 · 0 comments
Open

Prefetch not working properly #299

somehowchris opened this issue Feb 17, 2022 · 0 comments

Comments

@somehowchris
Copy link

somehowchris commented Feb 17, 2022

Describe the bug

As I understand it. prefetch set to 1 and acks_late set to true should take on a task, do it, acknowledge and start again.

As of my case. prefetch doesn't limit the tasks consumed. It just takes on what ever it can take

To Reproduce
Steps to reproduce the behavior:

Use the prefetch and acks_late option on the consumer.

i.e.

let my_app = celery::app!(
	broker = AMQPBroker { &environment.amqp_addr },
	tasks = [training_tasks::train_environments],
	task_routes = [],
	acks_late=true,
	prefetch_count=1,
)
.await
.expect("Could not connect to celery rabbitmq broker");

#[cfg(debug_assertions)]
my_app.display_pretty().await;

my_app
    .consume()
    .await
    .expect("Failed to consume from broker");

Expected behavior

  • Take task
  • Process it
  • Acknowlage
  • Take on new one

Screenshots
If applicable, add screenshots to help explain your problem.

System (please complete the following information):

  • OS: MacOS Monterey (12.2.1)
  • Broker: AMQP
  • Version:
celery = "0.4.0-rcn.11"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant