fix: assert equal-length worker lists in OneToOne ChannelConfig#5031
Open
Ma77Ball wants to merge 2 commits into
Open
fix: assert equal-length worker lists in OneToOne ChannelConfig#5031Ma77Ball wants to merge 2 commits into
Ma77Ball wants to merge 2 commits into
Conversation
Contributor
Author
|
/request-review @kunwp1 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5031 +/- ##
============================================
- Coverage 42.73% 42.72% -0.02%
+ Complexity 2191 2187 -4
============================================
Files 1045 1045
Lines 39979 39982 +3
Branches 4218 4219 +1
============================================
- Hits 17087 17082 -5
- Misses 21835 21840 +5
- Partials 1057 1060 +3
*This pull request uses carry forward flags. Click here to find out more. ☔ 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.
What changes were proposed in this PR?
ChannelConfig.generateChannelConfigspreviously usedfromWorkerIds.zip(toWorkerIds)for theOneToOnePartitionarm, which silently truncated to the shorter side and dropped surplus workers even though the partition'scontract is a strict 1:1 pairing. This PR adds an
assert(fromWorkerIds.size == toWorkerIds.size, ...)precondition (mirroring theSinglePartitionarm in the same file) so mismatched inputs fail loudly with a message thatnames both sizes.
Any related issues, documentation, or discussions?
Closes: #4799
How was this PR tested?
The existing
ChannelConfigSpeccase that pinned the truncation behavior is flipped to assert anAssertionErroris raised in both asymmetric directions (from > toandto > from). The equal-length, empty-input, and otherpartition arms are unchanged and still pass. Reproducer from the report (
from=3, to=2) now throws instead of returning a 2-element list.Was this PR authored or co-authored using generative AI tooling?
Co-authored with Claude Opus 4.7 in compliance with ASF