Skip to content

fix: return None from getWorkerIndex for non-worker actor IDs#5006

Merged
Xiao-zhen-Liu merged 17 commits into
apache:mainfrom
Ma77Ball:fix/getWorkerIndexMatchError
May 14, 2026
Merged

fix: return None from getWorkerIndex for non-worker actor IDs#5006
Xiao-zhen-Liu merged 17 commits into
apache:mainfrom
Ma77Ball:fix/getWorkerIndexMatchError

Conversation

@Ma77Ball
Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

VirtualIdentityUtils.getWorkerIndex only matched the worker name pattern with no fallback case, so passing a non-worker ActorVirtualIdentity (e.g. CONTROLLER, SELF) threw scala.MatchError at runtime. This PR adds a fallback case that returns -1 for non-worker actor IDs, matching the graceful handling already present in the sibling methods getPhysicalOpId and toShorterString.

Any related issues, documentation, discussions?

Closes: #4727

How was this PR tested?

Updated VirtualIdentityUtilsSpec the existing test that pinned the MatchError behavior was replaced with a test asserting that getWorkerIndex returns -1 for special actor IDs like CONTROLLER. The existing test for the worker-name happy path still passes unchanged.

Was this PR authored or co-authored using generative AI tooling?

Co-authored with Claude Opus 4.7 in compliance with ASF

@Ma77Ball Ma77Ball changed the title return -1 from getWorkerIndex for non-worker actor IDs instead of thr… fix: return -1 from getWorkerIndex for non-worker actor IDs May 10, 2026
@Ma77Ball
Copy link
Copy Markdown
Contributor Author

/request-review @Yicong-Huang

@github-actions github-actions Bot requested a review from Yicong-Huang May 10, 2026 03:29
@chenlica
Copy link
Copy Markdown
Contributor

@Ma77Ball Let's try to assign PRs to other committers.

@Xiao-zhen-Liu Please review it.

@chenlica chenlica requested review from Xiao-zhen-Liu and removed request for Yicong-Huang May 10, 2026 04:49
@Ma77Ball
Copy link
Copy Markdown
Contributor Author

@chenlica I've also used @aicam and @kunwp1. However, I get your point. I have used @aglinxinyuan and @Yicong-Huang a lot recently. Given the large codebase, it can be hard to know who to ask for PR reviews. It would be good to either:

  1. Have suggestions (automatically generated based on which parts of the codebase were edited)
  2. Descriptions of each committer and which parts of the codebase they are most comfortable with (a reference for contributors to use the /request-review feature manually).

I can raise an issue if you think this is an idea the project would like to pursue.

@Yicong-Huang
Copy link
Copy Markdown
Contributor

Let's not make PR triage too complicated for now. We can have auto suggestions as an improvement down the road, but for now it's easier and better to do manual triage: If a requested reviewer knows who have a better context, simply reassign.

Also, our code base is tiny, compared to other projects. You can usually do a git blame to find the owner/author of a component.

If not, feel free to request @chenlica and he can find ppl to review.

Let's not be blocked by some fancy auto triage method.

@Yicong-Huang
Copy link
Copy Markdown
Contributor

Yicong-Huang commented May 10, 2026

In addition, I highly suggest everyone to review more PRs, even if that's not your experty. Share your thoughts, learn the code base, ask questions.

For PR authors, feel free to request more ppl to get their attention.

Descriptions of each committer and which parts of the codebase they are most comfortable with (a reference for contributors to use the /request-review feature manually).

Everyone should be comfortable review all codebase. Don't own only a file, or two. Don't be shy. I encourage everyone (not just committers) to contribute to and review everywhere.

@chenlica
Copy link
Copy Markdown
Contributor

@Ma77Ball It will be easier for me to assign people to review PRs. Yes, we need more members to review PRs.

Copy link
Copy Markdown
Contributor

@Xiao-zhen-Liu Xiao-zhen-Liu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with minor comments.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 11, 2026

Codecov Report

❌ Patch coverage is 78.57143% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 42.88%. Comparing base (ac55403) to head (ed45984).

Files with missing lines Patch % Lines
...tecture/worker/managers/SerializationManager.scala 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5006      +/-   ##
============================================
+ Coverage     42.84%   42.88%   +0.04%     
- Complexity     2205     2207       +2     
============================================
  Files          1045     1045              
  Lines         40135    40065      -70     
  Branches       4240     4233       -7     
============================================
- Hits          17194    17181      -13     
+ Misses        21875    21819      -56     
+ Partials       1066     1065       -1     
Flag Coverage Δ *Carryforward flag
access-control-service 39.53% <ø> (ø)
agent-service 33.72% <ø> (ø) Carriedforward from 5bff1b4
amber 43.74% <78.57%> (+0.02%) ⬆️
computing-unit-managing-service 0.00% <ø> (ø)
config-service 0.00% <ø> (ø)
file-service 32.18% <ø> (ø)
frontend 34.05% <ø> (+0.12%) ⬆️ Carriedforward from 5bff1b4
python 88.89% <ø> (-0.11%) ⬇️ Carriedforward from 5bff1b4
workflow-compiling-service 47.72% <ø> (ø)

*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.

@Ma77Ball
Copy link
Copy Markdown
Contributor Author

@Xiao-zhen-Liu Thank you for the comments. I added the fixes.

@Yicong-Huang
Copy link
Copy Markdown
Contributor

If we changed to return None, could you please update PR description and title?

@Ma77Ball Ma77Ball changed the title fix: return -1 from getWorkerIndex for non-worker actor IDs fix: return None from getWorkerIndex for non-worker actor IDs May 13, 2026
@Xiao-zhen-Liu Xiao-zhen-Liu merged commit 8c07714 into apache:main May 14, 2026
17 checks passed
@Ma77Ball Ma77Ball deleted the fix/getWorkerIndexMatchError branch May 14, 2026 00:02
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.

VirtualIdentityUtils.getWorkerIndex throws MatchError on non-worker actor names

5 participants