Skip to content

pkg/dxf: avoid misleading error log on context cancel (#67612)#67673

Merged
ti-chi-bot[bot] merged 4 commits intopingcap:release-nextgen-202603from
ti-chi-bot:cherry-pick-67612-to-release-nextgen-202603
Apr 10, 2026
Merged

pkg/dxf: avoid misleading error log on context cancel (#67612)#67673
ti-chi-bot[bot] merged 4 commits intopingcap:release-nextgen-202603from
ti-chi-bot:cherry-pick-67612-to-release-nextgen-202603

Conversation

@ti-chi-bot
Copy link
Copy Markdown
Member

@ti-chi-bot ti-chi-bot commented Apr 10, 2026

This is an automated cherry-pick of #67612

What problem does this PR solve?

Issue Number: ref #67631

Problem Summary:

When a distributed task subtask exits because the context is canceled, the executor currently logs it as a failure. This produces misleading error logs for expected cancellation paths.

What changed and how does it work?

In BaseTaskExecutor.Run, handle runSubtask errors by type:

  • If the error is a context-canceled error (llog.IsContextCanceledError(err)), log an info message.
  • Otherwise keep logging the error as before.

This preserves error visibility for real failures while reducing noisy/misleading logs for expected cancellations.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test. just changing log printing
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

Summary by CodeRabbit

  • Chores
    • Improved logging behavior for canceled subtasks: context-canceled subtasks now log at info level instead of error level, with a more descriptive message.

@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. type/cherry-pick-for-release-nextgen-202603 labels Apr 10, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e6dbe0bd-dc4e-43b6-a98e-41166b80ae0c

📥 Commits

Reviewing files that changed from the base of the PR and between 909d3f8 and 61070c4.

📒 Files selected for processing (1)
  • pkg/dxf/framework/taskexecutor/task_executor.go

📝 Walkthrough

Walkthrough

Modified error logging in BaseTaskExecutor.Run to differentiate context-canceled subtask errors from other failures. Context-canceled errors now log at info level with a concise message instead of error level, while other error types retain previous error-level logging behavior.

Changes

Cohort / File(s) Summary
Task Executor Error Logging
pkg/dxf/framework/taskexecutor/task_executor.go
Changed error logging for e.runSubtask(subtask) to check if the error is a context-canceled error and log at info level with message "subtask run canceled by context" instead of logging as error with "run subtask failed".

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • D3Hunter
  • joechenrh
  • lance6716
  • Benjamin2037

Poem

🐰✨ A context that whispers goodbye,
No error bells need loudly cry!
Log gently at info, not with a frown,
When tasks bow out as they settle down. 🍀

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: avoiding misleading error logs when context is canceled in the dxf package.
Description check ✅ Passed The description follows the template with required sections completed: issue reference, problem summary, what changed, checklist, and release note.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.11.4)

Command failed


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ti-chi-bot ti-chi-bot Bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Apr 10, 2026
Copy link
Copy Markdown
Collaborator

@Benjamin2037 Benjamin2037 left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Apr 10, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Benjamin2037, D3Hunter

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

The pull request process is described 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 lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Apr 10, 2026
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Apr 10, 2026

[LGTM Timeline notifier]

Timeline:

  • 2026-04-10 02:59:15.11538886 +0000 UTC m=+1097960.320748917: ☑️ agreed by D3Hunter.
  • 2026-04-10 03:00:27.173739698 +0000 UTC m=+1098032.379099755: ☑️ agreed by Benjamin2037.

@D3Hunter
Copy link
Copy Markdown
Contributor

/retest

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (release-nextgen-202603@909d3f8). Learn more about missing BASE report.

Additional details and impacted files
@@                     Coverage Diff                     @@
##             release-nextgen-202603     #67673   +/-   ##
===========================================================
  Coverage                          ?   77.5451%           
===========================================================
  Files                             ?       1960           
  Lines                             ?     543433           
  Branches                          ?          0           
===========================================================
  Hits                              ?     421406           
  Misses                            ?     121175           
  Partials                          ?        852           
Flag Coverage Δ
unit 76.1395% <100.0000%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 61.5065% <0.0000%> (?)
parser ∅ <0.0000%> (?)
br 61.0035% <0.0000%> (?)
🚀 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.

@ti-chi-bot ti-chi-bot Bot merged commit 744884d into pingcap:release-nextgen-202603 Apr 10, 2026
18 checks passed
@ti-chi-bot ti-chi-bot Bot deleted the cherry-pick-67612-to-release-nextgen-202603 branch April 10, 2026 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. type/cherry-pick-for-release-nextgen-202603

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants