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

api (ticdc): check http request context in api helper #11165

Merged

Conversation

asddongmen
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #11046

What is changed and how it works?

Check List

Tests

  • Unit test

Questions

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

Release note

None

Signed-off-by: dongmen <414110582@qq.com>
@ti-chi-bot ti-chi-bot bot added the release-note-none Denotes a PR that doesn't merit a release note. label May 22, 2024
@asddongmen asddongmen requested a review from sdojjy May 22, 2024 09:04
@ti-chi-bot ti-chi-bot bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 22, 2024
@@ -551,5 +579,9 @@ func (h APIV2HelpersImpl) getVerifiedTables(
return nil, nil, err
}

if ctx.Err() != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps the redundant code can be reduced through a common ctxChecker function? eg:

func ctxChecker(ctx, fn func() error) {
    if fn() != nil {
		return nil, errors.Trace(err)
	}
	if ctx.Err() != nil {
		return nil, errors.Trace(ctx.Err())
	}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I prefer to write them each time in the api_helpers.go because it is more straightforward.

@asddongmen
Copy link
Contributor Author

/retest

Copy link

codecov bot commented May 27, 2024

Codecov Report

Attention: Patch coverage is 48.64865% with 19 lines in your changes are missing coverage. Please review.

Project coverage is 57.6232%. Comparing base (c07bce4) to head (97cb577).

Additional details and impacted files
Components Coverage Δ
cdc 61.4267% <48.6486%> (-0.0040%) ⬇️
dm 51.2162% <ø> (+0.0040%) ⬆️
engine 63.3738% <ø> (-0.0212%) ⬇️
Flag Coverage Δ
unit 57.6232% <48.6486%> (-0.0023%) ⬇️

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

@@               Coverage Diff                @@
##             master     #11165        +/-   ##
================================================
- Coverage   57.6254%   57.6232%   -0.0023%     
================================================
  Files           849        849                
  Lines        125934     125951        +17     
================================================
+ Hits          72570      72577         +7     
- Misses        47966      47975         +9     
- Partials       5398       5399         +1     

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels May 27, 2024
Copy link
Contributor

ti-chi-bot bot commented May 28, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CharlesCheung96, sdojjy

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 May 28, 2024
Copy link
Contributor

ti-chi-bot bot commented May 28, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-05-27 11:15:33.423396528 +0000 UTC m=+2688687.180532101: ☑️ agreed by sdojjy.
  • 2024-05-28 02:03:50.918165075 +0000 UTC m=+2741984.675300660: ☑️ agreed by CharlesCheung96.

@asddongmen
Copy link
Contributor Author

/retest

@asddongmen
Copy link
Contributor Author

/retest

@ti-chi-bot ti-chi-bot bot merged commit de3a888 into pingcap:master May 29, 2024
28 checks passed
@ti-chi-bot ti-chi-bot added needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. labels Jul 10, 2024
@ti-chi-bot
Copy link
Member

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

@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/tiflow that referenced this pull request Jul 10, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
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. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The Error message return by create changefeed API was misleading.
4 participants