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

Improve the order of message operation at _release_batch() #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kawasin73
Copy link

In order to avoid message lost, you should enqueue messages to Dead Letter Queue before deleting messages in case of sudden death of worker process.

I think it is better to release_messages() soon after checking RESET_TIMEOUT_THRESHOLD because delete_messages() may take some time.

Copy link
Contributor

@timnd timnd left a comment

Choose a reason for hiding this comment

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

Thanks, looks like a good improvement.

Comment on lines +302 to +306
if messages_to_be_deleted:
# Note: This includes failed tasks.
self._consumer.delete_messages(messages_to_be_deleted,
self._batch_queue.name)

Copy link
Contributor

Choose a reason for hiding this comment

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

Move this block before the comment block above.

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