Skip to content

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

Open
aglinxinyuan wants to merge 2 commits into
apache:mainfrom
aglinxinyuan:refactor/amber-worker-timer-pause
Open

aglinxinyuan wants to merge 2 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

This branch has not been deployed

No deployments
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

3 participants