Skip to content

Fix(stream): read based on allowed to take jobs#8

Merged
saber-solooki merged 1 commit intomainfrom
saber/fix-counter
May 14, 2025
Merged

Fix(stream): read based on allowed to take jobs#8
saber-solooki merged 1 commit intomainfrom
saber/fix-counter

Conversation

@saber-solooki
Copy link

@saber-solooki saber-solooki commented May 14, 2025

The last problem regarding reading the correct number of tasks based on max_jobs has been mitigated, but there is still a small corner case. Jobs can take time differently. So, imagine a worker is allowed to handle 5 tasks concurrently. 1 of them finished sooner than the others. Now this condition will be passed since job_counter is 4 and max_job is 5. But stream still reads 5 events and as soon as the first job gets started, this condition will be met and the remaining 4 tasks will be ignored.
This PR addressed this issue by always reading the correct number of tasks from the stream

@saber-solooki saber-solooki merged commit 8ea5372 into main May 14, 2025
1 of 9 checks passed
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