Skip to content

refactor(amber): remove the no-op batching pause/resume - #9029

Merged
aglinxinyuan merged 3 commits into
apache:mainfrom
aglinxinyuan:refactor/amber-worker-timer-pause
Oct 24, 2026
Merged

aglinxinyuan merged 3 commits into
apache:mainfrom
aglinxinyuan:refactor/amber-worker-timer-pause

Conversation

@aglinxinyuan

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Removes the adaptive-batching pause/resume pair from WorkerTimerService, which can no longer do anything. +7/−106 lines. There is no behaviour change.

  • WorkerTimerService.scala: pauseAdaptiveBatching(), resumeAdaptiveBatching(), and the isPaused flag (with its reset in stopAdaptiveBatching). isPaused could only be set by pauseAdaptiveBatching(), which has no production caller, so resumeAdaptiveBatching() has never re-armed the timer since then.
  • ResumeHandler.scala: the no-op resumeAdaptiveBatching() call. The rest of the handler is unchanged. Pause and resume leave the flush timer alone, both before and after this PR.
  • Specs: WorkerTimerServiceSpec loses the four cases that only exercised the removed methods. Its start/stop cases drop their isPaused asserts, and one stop case that called pause now stops twice instead, keeping its repeated-cancel assertion. DPThreadSpec drops eight resumeAdaptiveBatching mock expectations.

PauseManager.isPaused, a different and live member, is untouched.

History

Introduced by #1826 (2023-02-02), "Add time-based batch in network output buffer": the pause method. #2208 (2023-11-16), "Refactoring of amber engine", moved it into WorkerTimerService and added isPaused, resumeAdaptiveBatching() and the ResumeHandler call
Usage removed by #2392 (2024-02-19), "Remove breakpoint feature". It deleted the last pauseAdaptiveBatching() caller, the breakpoint branch in DataProcessor

It has done nothing for over two and a half years.

Any related issues, documentation, discussions?

Closes #9026

How was this PR tested?

No new tests. The surviving start/stop behaviour keeps its cases.

Locally, from the repo root with Java 17:

  • sbt "WorkflowExecutionService/Test/compile" "WorkflowExecutionService/scalafmtCheckAll" "WorkflowExecutionService/scalafixAll --check": success.
  • sbt "WorkflowExecutionService/testOnly *WorkerTimerServiceSpec *DPThreadSpec *DataProcessorSpec *WorkerSpec *LoggingSpec *CoordinatorTimerServiceSpec": 6 suites, 53 tests, all pass.
  • sbt "WorkflowExecutionService/testOnly *e2e.PauseSpec", which runs a real pause/resume through ResumeHandler: 2 tests, both pass.

To re-check:

git grep -n -e pauseAdaptiveBatching -e resumeAdaptiveBatching   # no hits

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

Generated-by: Claude Code (Claude Opus 5.5)

🤖 Generated with Claude Code

WorkerTimerService.isPaused is only set by pauseAdaptiveBatching(),
whose last caller apache#2392 removed, so resumeAdaptiveBatching() and its
call in the worker ResumeHandler have done nothing since. Remove the
pair, the flag and the call; start/stop are unchanged.
Copilot AI balanced review requested due to automatic review settings October 19, 2026 07:07
@aglinxinyuan aglinxinyuan self-assigned this Oct 19, 2026

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 github-actions Bot added engine refactor Refactor the code labels Oct 19, 2026
@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: @Ma77Ball, @Yicong-Huang
    You can notify them by mentioning @Ma77Ball, @Yicong-Huang in a comment.

@aglinxinyuan
aglinxinyuan requested a review from kunwp1 October 19, 2026 21:06
@kunwp1
kunwp1 requested a lite review from Copilot October 20, 2026 17:38

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

No open issues 🎉

Review effort: Lite

@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 6cfcfb1 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 557 0.34 17,653/24,928/24,928 us 🔴 +19.1% / 🔴 +76.5%
🔴 bs=100 sw=10 sl=64 1,582 0.966 59,431/93,392/93,392 us 🔴 +6.0% / 🟢 -29.0%
⚪ bs=1000 sw=10 sl=64 2,000 1.221 492,489/595,923/595,923 us ⚪ within ±5% / 🟢 +51.5%
Baseline details

Latest main 6cfcfb1 from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 557 tuples/sec 606 tuples/sec 968.33 tuples/sec -8.1% -42.5%
bs=10 sw=10 sl=64 MB/s 0.34 MB/s 0.37 MB/s 0.591 MB/s -8.1% -42.5%
bs=10 sw=10 sl=64 p50 17,653 us 14,827 us 10,646 us +19.1% +65.8%
bs=10 sw=10 sl=64 p95 24,928 us 26,346 us 14,120 us -5.4% +76.5%
bs=10 sw=10 sl=64 p99 24,928 us 26,346 us 16,498 us -5.4% +51.1%
bs=100 sw=10 sl=64 throughput 1,582 tuples/sec 1,530 tuples/sec 1,252 tuples/sec +3.4% +26.3%
bs=100 sw=10 sl=64 MB/s 0.966 MB/s 0.934 MB/s 0.764 MB/s +3.4% +26.4%
bs=100 sw=10 sl=64 p50 59,431 us 61,863 us 83,736 us -3.9% -29.0%
bs=100 sw=10 sl=64 p95 93,392 us 88,103 us 92,464 us +6.0% +1.0%
bs=100 sw=10 sl=64 p99 93,392 us 88,103 us 108,561 us +6.0% -14.0%
bs=1000 sw=10 sl=64 throughput 2,000 tuples/sec 1,970 tuples/sec 1,321 tuples/sec +1.5% +51.4%
bs=1000 sw=10 sl=64 MB/s 1.221 MB/s 1.203 MB/s 0.806 MB/s +1.5% +51.5%
bs=1000 sw=10 sl=64 p50 492,489 us 497,544 us 811,260 us -1.0% -39.3%
bs=1000 sw=10 sl=64 p95 595,923 us 617,276 us 847,636 us -3.5% -29.7%
bs=1000 sw=10 sl=64 p99 595,923 us 617,276 us 879,277 us -3.5% -32.2%
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.27,200,128000,557,0.340,17653.43,24927.89,24927.89
1,100,10,64,20,1263.95,2000,1280000,1582,0.966,59430.61,93392.39,93392.39
2,1000,10,64,20,9999.32,20000,12800000,2000,1.221,492488.54,595922.96,595922.96

@codecov-commenter

codecov-commenter commented Oct 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.33%. Comparing base (6cfcfb1) to head (e680557).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9029      +/-   ##
============================================
- Coverage     92.34%   92.33%   -0.01%     
+ Complexity     5046     5041       -5     
============================================
  Files          1261     1261              
  Lines         54117    54110       -7     
  Branches       6767     6767              
============================================
- Hits          49973    49964       -9     
- Misses         2485     2486       +1     
- Partials       1659     1660       +1     
Flag Coverage Δ *Carryforward flag
access-control-service 77.38% <ø> (ø) Carriedforward from 6cfcfb1
agent-service 99.16% <ø> (ø) Carriedforward from 6cfcfb1
amber 87.31% <ø> (-0.02%) ⬇️
computing-unit-managing-service 60.48% <ø> (ø) Carriedforward from 6cfcfb1
config-service 87.37% <ø> (ø) Carriedforward from 6cfcfb1
file-service 82.00% <ø> (ø) Carriedforward from 6cfcfb1
frontend 96.56% <ø> (ø) Carriedforward from 6cfcfb1
notebook-migration-service 83.73% <ø> (ø) Carriedforward from 6cfcfb1
pyamber 98.57% <ø> (ø) Carriedforward from 6cfcfb1
workflow-compiling-service 72.43% <ø> (ø) Carriedforward from 6cfcfb1

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

@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Oct 24, 2026
Merged via the queue into apache:main with commit f674649 Oct 24, 2026
22 checks passed
@aglinxinyuan
aglinxinyuan deleted the refactor/amber-worker-timer-pause branch October 24, 2026 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine refactor Refactor the code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove the no-op adaptive-batching pause and resume in WorkerTimerService

4 participants