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

backend, net: add more error sources #407

Merged
merged 5 commits into from
Dec 1, 2023
Merged

Conversation

djshow832
Copy link
Collaborator

@djshow832 djshow832 commented Nov 21, 2023

What problem does this PR solve?

Issue Number: close #404

Problem Summary:
The error sources are not enough to judge whether the client quits normally or abnormally.

What is changed and how it works:

  • Add more kinds of error sources.
  • It was unreadable to set the error source for OnHandshake and reset it, so I added an ErrorSource parameter for OnHandshake& OnConnClose and removed the interface ConnContext.ErrorSource().
  • Add more predefined errors and wrap all the errors with these predefined errors so that we can track them correctly.
  • Add Error2Source to convert an error to an ErrorSource.
  • Remove UserError. Convert tracked errors to MySQL errors by ErrToClient().

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Notable changes

  • Has configuration change
  • Has HTTP API interfaces change
  • Has tiproxyctl change
  • Other user behavior changes

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 size/XL and removed size/L labels Nov 23, 2023
@ti-chi-bot ti-chi-bot bot added size/XXL and removed size/XL labels Nov 30, 2023
@djshow832 djshow832 marked this pull request as ready for review November 30, 2023 12:41
@djshow832 djshow832 marked this pull request as ready for review November 30, 2023 12:49
Copy link

ti-chi-bot bot commented Dec 1, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: xhebox

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 the lgtm label Dec 1, 2023
Copy link

ti-chi-bot bot commented Dec 1, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-12-01 07:30:39.233183769 +0000 UTC m=+1167067.898409963: ☑️ agreed by xhebox.

@ti-chi-bot ti-chi-bot bot added the approved label Dec 1, 2023
@ti-chi-bot ti-chi-bot bot merged commit f22f82b into pingcap:main Dec 1, 2023
9 checks passed
@djshow832 djshow832 deleted the src_error branch December 1, 2023 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add more metrics to judge the reason of disconnection
2 participants