fix(sv-consumer): Ensure block is process before act on it and get on next block #480
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request refactors the
BlockExecutor
inservices/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:
MAX_CONCURRENT_TASKS
from 32 to 30 andBATCH_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)
)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:
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)
)