Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disttask: fix cancel from grpc mark subtasks as failed #48339

Merged
merged 9 commits into from
Nov 8, 2023

Conversation

ywqzzy
Copy link
Contributor

@ywqzzy ywqzzy commented Nov 7, 2023

What problem does this PR solve?

Issue Number: close #48324

Problem Summary:

What is changed and how it works?

Ignore context.Cancel from grpc, then retry the subtask.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • 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

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 7, 2023
Copy link

tiprow bot commented Nov 7, 2023

Hi @ywqzzy. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link

codecov bot commented Nov 7, 2023

Codecov Report

Merging #48339 (1084ad1) into master (633d223) will increase coverage by 1.3658%.
Report is 10 commits behind head on master.
The diff coverage is 50.0000%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #48339        +/-   ##
================================================
+ Coverage   71.3791%   72.7450%   +1.3658%     
================================================
  Files          1402       1425        +23     
  Lines        406780     413726      +6946     
================================================
+ Hits         290356     300965     +10609     
+ Misses        96504      93823      -2681     
+ Partials      19920      18938       -982     
Flag Coverage Δ
integration 43.2635% <0.0000%> (?)
unit 71.3910% <50.0000%> (+0.0119%) ⬆️

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

Components Coverage Δ
dumpling 53.9874% <ø> (ø)
parser ∅ <ø> (∅)
br 48.6675% <ø> (-4.2493%) ⬇️

@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 7, 2023
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 7, 2023
@ywqzzy
Copy link
Contributor Author

ywqzzy commented Nov 7, 2023

/retest

Copy link

tiprow bot commented Nov 7, 2023

@ywqzzy: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. do-not-merge/needs-tests-checked labels Nov 7, 2023
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Nov 7, 2023
Copy link
Contributor

@D3Hunter D3Hunter left a comment

Choose a reason for hiding this comment

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

rest lgtm

@@ -608,6 +610,8 @@ func (s *BaseScheduler) markSubTaskCanceledOrFailed(ctx context.Context, subtask
if ctx.Err() != nil && context.Cause(ctx) == ErrCancelSubtask {
logutil.Logger(s.logCtx).Warn("subtask canceled", zap.Error(err))
s.updateSubtaskStateAndError(subtask, proto.TaskStateCanceled, nil)
} else if status.Code(err) == codes.Canceled {
Copy link
Contributor

Choose a reason for hiding this comment

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

use errors.Cause to unwrap?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I follow the code in br/pkg/lightning/log/log.go:181.

Copy link
Contributor

Choose a reason for hiding this comment

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

no harm to do it, in case somewhere wrap it, ok to leave it

@D3Hunter
Copy link
Contributor

D3Hunter commented Nov 8, 2023

/lgtm

Copy link

ti-chi-bot bot commented Nov 8, 2023

[APPROVALNOTIFIER] This PR is APPROVED

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

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

The pull request process is described here

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 Nov 8, 2023
Copy link

ti-chi-bot bot commented Nov 8, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-11-07 12:10:47.957787359 +0000 UTC m=+3559845.544897503: ☑️ agreed by tangenta.
  • 2023-11-08 02:38:34.939846704 +0000 UTC m=+3611912.526956862: ☑️ agreed by D3Hunter.

@ti-chi-bot ti-chi-bot bot added needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. and removed do-not-merge/needs-triage-completed labels Nov 8, 2023
@ywqzzy
Copy link
Contributor Author

ywqzzy commented Nov 8, 2023

/retest

Copy link

tiprow bot commented Nov 8, 2023

@ywqzzy: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@D3Hunter
Copy link
Contributor

D3Hunter commented Nov 8, 2023

/hold

need to unwrap err

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 8, 2023
@D3Hunter
Copy link
Contributor

D3Hunter commented Nov 8, 2023

/unhold

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 8, 2023
@ywqzzy
Copy link
Contributor Author

ywqzzy commented Nov 8, 2023

/retest

Copy link

tiprow bot commented Nov 8, 2023

@ywqzzy: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@hawkingrei
Copy link
Member

/retest

1 similar comment
@ywqzzy
Copy link
Contributor Author

ywqzzy commented Nov 8, 2023

/retest

Copy link

tiprow bot commented Nov 8, 2023

@ywqzzy: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ti-chi-bot ti-chi-bot bot merged commit 5a458cf into pingcap:master Nov 8, 2023
13 of 16 checks passed
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #48416.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
5 participants