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

proxy: reject connection after graceful wait #525

Merged
merged 3 commits into from
May 7, 2024

Conversation

djshow832
Copy link
Collaborator

@djshow832 djshow832 commented May 6, 2024

What problem does this PR solve?

Issue Number: close #524

Problem Summary:
In #400, I intended to accept connection during graceful wait so that client connections won't fail during tiproxy shutting down.
However, in #443, I somehow broke that behavior when I was fixing a data race.

What is changed and how it works:

  • Do not reject connections during graceful-wait-before-shutdown
  • Defer unlocking just in case it panics and all other connections block

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.

- Do not reject new connections until `graceful-wait-before-shutdown` finishes

@ti-chi-bot ti-chi-bot bot requested review from bb7133 and xhebox May 6, 2024 12:10
@ti-chi-bot ti-chi-bot bot added the size/L label May 6, 2024
@codecov-commenter
Copy link

codecov-commenter commented May 6, 2024

Codecov Report

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

❗ No coverage uploaded for pull request base (main@a34431a). Click here to learn what that means.

Files Patch % Lines
pkg/proxy/proxy.go 81.48% 3 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #525   +/-   ##
=======================================
  Coverage        ?   65.41%           
=======================================
  Files           ?       71           
  Lines           ?     6413           
  Branches        ?        0           
=======================================
  Hits            ?     4195           
  Misses          ?     1900           
  Partials        ?      318           
Flag Coverage Δ
unit 65.41% <81.48%> (?)

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@djshow832 djshow832 marked this pull request as draft May 6, 2024 13:14
@djshow832 djshow832 marked this pull request as ready for review May 6, 2024 13:19
Copy link

ti-chi-bot bot commented May 7, 2024

[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

Copy link

ti-chi-bot bot commented May 7, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-05-07 03:06:11.01503808 +0000 UTC m=+931324.772173647: ☑️ agreed by xhebox.

@ti-chi-bot ti-chi-bot bot merged commit b1d8568 into pingcap:main May 7, 2024
4 of 5 checks passed
@djshow832 djshow832 deleted the graceful_wait branch May 7, 2024 04:25
djshow832 added a commit to djshow832/TiProxy that referenced this pull request May 7, 2024
Co-authored-by: 张明 <zhangming@zhangmingdeMacBook-Pro.local>
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.

Creating new connection fails during graceful-wait-before-shutdown
3 participants