Conversation
When the queueing occurs on workers directly, the factory wasn't tracking the in-flight message count correctly, such that the worker might still have work in-flight when requesting a draining operation. This change fixes 2 things 1. The evaluation of if a worker is "empty" of all jobs, i.e. drained 2. The tracking of the current job on the worker, when a worker has locally dequeued the next job. Test coverage added for this scenario. Prior to the fix, the added test fails with ``` thread 'factory::tests::draining_requests::test_worker_drains_when_worker_queueing' panicked at ractor/src/factory/tests/draining_requests.rs:221:5: assertion `left == right` failed left: 999 right: 1 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ```
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #353 +/- ##
==========================================
+ Coverage 80.95% 80.99% +0.03%
==========================================
Files 70 70
Lines 14367 14415 +48
==========================================
+ Hits 11631 11675 +44
- Misses 2736 2740 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When the queueing occurs on workers directly, the factory wasn't tracking the in-flight message count correctly, such that the worker might still have work in-flight when requesting a draining operation.
This change fixes 2 things
Test coverage added for this scenario. Prior to the fix, the added test fails with
since the factory was marked "drained" prior to all messages completing. Now it passes with this patch.
Also docs updated.