Skip to content

fix: assert equal-length worker lists in OneToOne ChannelConfig#5031

Open
Ma77Ball wants to merge 2 commits into
apache:mainfrom
Ma77Ball:fix/channelConfigSilentTruncate
Open

fix: assert equal-length worker lists in OneToOne ChannelConfig#5031
Ma77Ball wants to merge 2 commits into
apache:mainfrom
Ma77Ball:fix/channelConfigSilentTruncate

Conversation

@Ma77Ball
Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

ChannelConfig.generateChannelConfigs previously used fromWorkerIds.zip(toWorkerIds) for the OneToOnePartition arm, which silently truncated to the shorter side and dropped surplus workers even though the partition's
contract is a strict 1:1 pairing. This PR adds an assert(fromWorkerIds.size == toWorkerIds.size, ...) precondition (mirroring the SinglePartition arm in the same file) so mismatched inputs fail loudly with a message that
names both sizes.

Any related issues, documentation, or discussions?

Closes: #4799

How was this PR tested?

The existing ChannelConfigSpec case that pinned the truncation behavior is flipped to assert an AssertionError is raised in both asymmetric directions (from > to and to > from). The equal-length, empty-input, and other
partition 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

@Ma77Ball
Copy link
Copy Markdown
Contributor Author

/request-review @kunwp1

@github-actions github-actions Bot requested a review from kunwp1 May 12, 2026 19:52
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 42.72%. Comparing base (7879c2a) to head (c8595aa).
⚠️ Report is 1 commits behind head on main.

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     
Flag Coverage Δ *Carryforward flag
access-control-service 39.53% <ø> (ø) Carriedforward from 7879c2a
agent-service 33.72% <ø> (ø) Carriedforward from 7879c2a
amber 43.34% <100.00%> (-0.05%) ⬇️
computing-unit-managing-service 0.00% <ø> (ø) Carriedforward from 7879c2a
config-service 0.00% <ø> (ø) Carriedforward from 7879c2a
file-service 32.18% <ø> (ø) Carriedforward from 7879c2a
frontend 34.04% <ø> (ø) Carriedforward from 7879c2a
python 88.90% <ø> (ø) Carriedforward from 7879c2a
workflow-compiling-service 47.72% <ø> (ø) Carriedforward from 7879c2a

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ChannelConfig.generateChannelConfigs silently truncates OneToOnePartition for unequal-length input

2 participants