Skip to content

Modernize engine#12721

Open
dveeden wants to merge 3 commits into
pingcap:masterfrom
dveeden:modern_engine
Open

Modernize engine#12721
dveeden wants to merge 3 commits into
pingcap:masterfrom
dveeden:modern_engine

Conversation

@dveeden

@dveeden dveeden commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: ref #12691

What is changed and how it works?

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Questions

Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?

Release note

None

@ti-chi-bot ti-chi-bot Bot added release-note-none Denotes a PR that doesn't merit a release note. area/engine Issues or PRs related to Dataflow Engine. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jun 16, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the codebase to adopt Go 1.22 features, including range-over-int loops, replacing interface{} with any, utilizing maps.Copy for map duplication, and optimizing string construction with strings.Builder. However, a critical compilation issue was introduced across multiple test files where the standard library sync.WaitGroup is incorrectly called with a non-existent Go method. The review comments accurately identify these compilation errors and provide correct suggestions to revert to the standard wg.Add(1) and goroutine pattern.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +79 to +82
wg.Go(func() {
err := jobAPISrv.listenStoppedJobs(context.Background(), stoppedJobs)
require.NoError(t, err)
}()
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

The standard library sync.WaitGroup does not have a Go method. Calling wg.Go(...) will cause a compilation error. Please revert this change to use the standard wg.Add(1) and go func() { defer wg.Done(); ... }() pattern.

Suggested change
wg.Go(func() {
err := jobAPISrv.listenStoppedJobs(context.Background(), stoppedJobs)
require.NoError(t, err)
}()
})
wg.Add(1)
go func() {
defer wg.Done()
err := jobAPISrv.listenStoppedJobs(context.Background(), stoppedJobs)
require.NoError(t, err)
}()

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.

How to make Gemini shut up about these (*WaitGroup).Go changes?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As Gemini Code Assist is going the way of the Dodo this isn't worth the effort.

Comment thread engine/executor/worker/task_runner_test.go
Comment thread engine/framework/internal/eventloop/runner_test.go
Comment thread engine/pkg/client/executor_group_test.go
Comment thread engine/pkg/dm/message_agent_test.go
Comment thread engine/pkg/errctx/center_test.go
@dveeden

dveeden commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

/cc @kennytm @GMHDBJD

@ti-chi-bot ti-chi-bot Bot requested review from GMHDBJD and kennytm June 16, 2026 07:37

@kennytm kennytm 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.

iirc engine is no longer maintained though 🤔

Comment thread engine/jobmaster/dm/ddl_coordinator_test.go Outdated
Comment thread engine/pkg/externalresource/manager/test_utils.go Outdated
Comment thread engine/pkg/externalresource/manager/test_utils.go Outdated
Comment thread engine/pkg/meta/model/common.go Outdated
@ti-chi-bot

ti-chi-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: kennytm
Once this PR has been reviewed and has the lgtm label, please assign gmhdbjd for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jun 25, 2026
@ti-chi-bot

ti-chi-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

[LGTM Timeline notifier]

Timeline:

  • 2026-06-25 09:41:49.879574162 +0000 UTC m=+199793.542799675: ☑️ agreed by kennytm.

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

Labels

area/engine Issues or PRs related to Dataflow Engine. needs-1-more-lgtm Indicates a PR needs 1 more LGTM. release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants