Skip to content

chore(pyamber): remove the unused worker-to-worker RPC proxy - #7794

Open
aglinxinyuan wants to merge 1 commit into
apache:mainfrom
aglinxinyuan:cleanup/pyamber-worker-rpc-proxy
Open

chore(pyamber): remove the unused worker-to-worker RPC proxy#7794
aglinxinyuan wants to merge 1 commit into
apache:mainfrom
aglinxinyuan:cleanup/pyamber-worker-rpc-proxy

Conversation

@aglinxinyuan

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Removes AsyncRPCClient.get_worker_interface and the _create_proxy helper it is the sole caller of. 109 lines deleted, 0 added.

Python workers talk only to the coordinator. The one production construction of the Python AsyncRPCClient is main_loop.py:114, and it uses coordinator_stub() (lines 271, 651, 671, 817) and receive (line 475). Worker-to-worker RPC initiated from Python is unused.

Grep Result
get_worker_interface its definition, plus three call sites — all in test_async_rpc_client.py
WorkerServiceStub async_rpc_client.py only: the import, the return annotation, one argument. No .scala hit
_create_proxy its definition, and one call inside get_worker_interface — its sole caller
_stream_unary / _unary_stream / _stream_stream only the Proxy blockers inside _create_proxy, plus those three tests

There is no getattr-style dynamic access anywhere. Scala's workerInterface (AsyncRPCClient.scala:140, WorkerServiceFs2Grpc) is a separate class and unrelated to this Python method.

_create_proxy is removed whole rather than just its _unary_unary body: with its only caller gone, leaving a Proxy class holding three stream blockers and no reachable constructor would just relocate the dead code. The now-orphaned WorkerServiceStub import goes too — it was the only orphan, since every other import is still used by _assign_context / _create_future / receive.

Three tests were removed, deliberately

test_stream_unary_blocked, test_unary_stream_blocked and test_stream_stream_blocked each begin with client.get_worker_interface(...) and then assert on blockers that exist only inside _create_proxy's local Proxy. They exercise nothing else. Their removal orphaned import pytest — the file's only pytest. uses were those three pytest.raises calls — so that went as well. The coordinator path is untouched: it goes through _assign_context, never had the blockers, and keeps its own tests.

Scope: one item was assessed and deliberately kept

The audit that produced this also flagged IcebergDocument's read side (get_uri, get_range, get_after, get_count) as having no production callers — only get() and writer() are used (input_port_materialization_reader_runnable.py:161,170, main_loop.py:157,216, output_manager.py:148).

None of it is removed here, because unlike the RPC proxy these are working implementations of @abstractmethods on ReadonlyVirtualDocument, i.e. the read contract IcebergDocument exists to fulfil:

  • get_range, get_after and get_count have live passing tests asserting real Iceberg behaviour, and get_range/get_after are the only public entry points to the ranged form of _get_using_file_sequence_order. Removing them would strand num_of_skipped_records, total_records_to_return, _skip_records and the skip loop in IcebergIterator.
  • get_uri has zero references of any kind, so it is removable — but it is a working override, and deleting it silently changes behaviour from "returns the table location" to "raises NotImplementedError" via VirtualDocument's fallback, and drops parity with Scala's IcebergDocument.getURI. That is an API decision, not a cleanup, so it is left for a maintainer.

Verification

Run Result
core/architecture/rpc/ 38 passed
core/architecture/rpc/ + core/storage/model/ 49 passed
core/architecture + core/storage + test_main_loop.py, -m "not integration" 448 passed, 1 deselected

The deselected test is test_iceberg_rest_catalog_integration.py, excluded by its own pytestmark.

ruff format --check src/main/python src/test/python → exit 0, "209 files already formatted". ruff check → exit 0, "All checks passed!". git diff --numstat shows 0 insertions against 109 deletions, so there are no incidental rewrites.

Any related issues, documentation, discussions?

Closes #7793

How was this PR tested?

python -m pytest src/test/python/core/architecture/rpc/ -q
38 passed, 1 warning

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

Generated-by: Claude Code (Opus 5)

Copilot AI lite review requested due to automatic review settings August 19, 2026 23:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @Yicong-Huang
    You can notify them by mentioning @Yicong-Huang in a comment.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

🟢 2 better · 🔴 5 worse · ⚪ 8 noise (<±5%) · 0 without baseline

Compared against main ee06e4b benchmarked on this same runner, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.

Dashboard · Run

config throughput MB/s latency max Δ latest / 7d
🔴 bs=10 sw=10 sl=64 556 0.339 17,262/22,125/22,125 us 🔴 +11.3% / 🔴 +41.9%
🔴 bs=100 sw=10 sl=64 1,164 0.71 83,558/115,068/115,068 us 🔴 +8.9% / 🟢 +16.7%
bs=1000 sw=10 sl=64 1,437 0.877 695,731/754,174/754,174 us ⚪ within ±5% / 🟢 +38.5%
Baseline details

Latest main ee06e4b from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 556 tuples/sec 612 tuples/sec 771.02 tuples/sec -9.2% -27.9%
bs=10 sw=10 sl=64 MB/s 0.339 MB/s 0.373 MB/s 0.471 MB/s -9.1% -28.0%
bs=10 sw=10 sl=64 p50 17,262 us 15,507 us 12,749 us +11.3% +35.4%
bs=10 sw=10 sl=64 p95 22,125 us 23,642 us 15,594 us -6.4% +41.9%
bs=10 sw=10 sl=64 p99 22,125 us 23,642 us 19,320 us -6.4% +14.5%
bs=100 sw=10 sl=64 throughput 1,164 tuples/sec 1,200 tuples/sec 997.05 tuples/sec -3.0% +16.7%
bs=100 sw=10 sl=64 MB/s 0.71 MB/s 0.732 MB/s 0.609 MB/s -3.0% +16.7%
bs=100 sw=10 sl=64 p50 83,558 us 81,769 us 100,339 us +2.2% -16.7%
bs=100 sw=10 sl=64 p95 115,068 us 105,655 us 106,781 us +8.9% +7.8%
bs=100 sw=10 sl=64 p99 115,068 us 105,655 us 113,101 us +8.9% +1.7%
bs=1000 sw=10 sl=64 throughput 1,437 tuples/sec 1,433 tuples/sec 1,037 tuples/sec +0.3% +38.5%
bs=1000 sw=10 sl=64 MB/s 0.877 MB/s 0.875 MB/s 0.633 MB/s +0.2% +38.5%
bs=1000 sw=10 sl=64 p50 695,731 us 696,815 us 971,388 us -0.2% -28.4%
bs=1000 sw=10 sl=64 p95 754,174 us 790,807 us 1,013,249 us -4.6% -25.6%
bs=1000 sw=10 sl=64 p99 754,174 us 790,807 us 1,039,879 us -4.6% -27.5%
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,359.93,200,128000,556,0.339,17262.16,22124.73,22124.73
1,100,10,64,20,1718.46,2000,1280000,1164,0.710,83557.55,115068.42,115068.42
2,1000,10,64,20,13921.47,20000,12800000,1437,0.877,695731.06,754173.71,754173.71

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.26%. Comparing base (c927890) to head (ec72cea).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #7794   +/-   ##
=========================================
  Coverage     91.25%   91.26%           
  Complexity     4471     4471           
=========================================
  Files          1171     1171           
  Lines         47124    47103   -21     
  Branches       5286     5286           
=========================================
- Hits          43003    42988   -15     
+ Misses         2447     2441    -6     
  Partials       1674     1674           
Flag Coverage Δ *Carryforward flag
access-control-service 81.00% <ø> (ø) Carriedforward from c927890
agent-service 98.62% <ø> (ø) Carriedforward from c927890
amber 88.02% <ø> (ø) Carriedforward from c927890
computing-unit-managing-service 73.67% <ø> (ø) Carriedforward from c927890
config-service 86.73% <ø> (ø) Carriedforward from c927890
file-service 68.90% <ø> (ø) Carriedforward from c927890
frontend 92.63% <ø> (ø) Carriedforward from c927890
notebook-migration-service 83.74% <ø> (ø) Carriedforward from c927890
pyamber 97.69% <ø> (+0.11%) ⬆️
workflow-compiling-service 77.19% <ø> (ø) Carriedforward from c927890

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

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pyamber's worker-to-worker RPC proxy has no production callers

3 participants