Skip to content

Conversation

luizstacio
Copy link
Member

This pull request refactors the BlockExecutor in services/consumer/src/executor/block_executor.rs to improve task management and message acknowledgment. The key changes include adjusting task concurrency limits, simplifying the subscription loop, and ensuring message acknowledgment is conditional on successful processing.

Task Management Updates:

  • Reduced MAX_CONCURRENT_TASKS from 32 to 30 and BATCH_SIZE from 100 to 30 to optimize resource usage. ([services/consumer/src/executor/block_executor.rsL56-R57](https://github.com/FuelLabs/data-systems/pull/480/files#diff-447b500ed8564ef462714e0456a8575d529b6dfdc64d26b85f331ad9474dcc55L56-R57))
  • Refactored the subscription loop to create a new JoinSet for each batch of messages, ensuring tasks are processed and completed sequentially within each batch. ([services/consumer/src/executor/block_executor.rsL104-L123](https://github.com/FuelLabs/data-systems/pull/480/files#diff-447b500ed8564ef462714e0456a8575d529b6dfdc64d26b85f331ad9474dcc55L104-L123))

Message Acknowledgment Improvements:

  • Modified message acknowledgment (msg.ack()) to occur only after successful processing, preventing acknowledgment of failed tasks. ([[1]](https://github.com/FuelLabs/data-systems/pull/480/files#diff-447b500ed8564ef462714e0456a8575d529b6dfdc64d26b85f331ad9474dcc55R132-R145), [[2]](https://github.com/FuelLabs/data-systems/pull/480/files#diff-447b500ed8564ef462714e0456a8575d529b6dfdc64d26b85f331ad9474dcc55L165-L169))

@luizstacio luizstacio merged commit 3d22e81 into main May 30, 2025
35 checks passed
@luizstacio luizstacio deleted the ls/fix/consumer-parallel-exec branch May 30, 2025 22:40
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.

1 participant