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

ddl: implement backoff strategy for async event notification in tests #58386

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

Rustin170506
Copy link
Member

@Rustin170506 Rustin170506 commented Dec 18, 2024

What problem does this PR solve?

Issue Number: close #58344 close #58421

Problem Summary:

What changed and how does it work?

Enhance the asyncNotifyEvent function to include a backoff mechanism when sending events to the channel during unit tests. This prevents indefinite blocking on a full channel by attempting to send the event multiple times before giving up, while also logging a warning if the notification fails.

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

Enhance the asyncNotifyEvent function to include a backoff mechanism when sending events to the channel during unit tests. This prevents indefinite blocking on a full channel by attempting to send the event multiple times before giving up, while also logging a warning if the notification fails.

Signed-off-by: Rustin170506 <[email protected]>
@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-triage-completed 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. and removed do-not-merge/needs-triage-completed labels Dec 18, 2024
@Rustin170506 Rustin170506 added the component/ddl This issue is related to DDL of TiDB. label Dec 18, 2024
Copy link
Member Author

@Rustin170506 Rustin170506 left a comment

Choose a reason for hiding this comment

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

🔢 Self-check (PR reviewed by myself and ready for feedback.)

Copy link
Contributor

@lance6716 lance6716 left a comment

Choose a reason for hiding this comment

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

not sure if 10 * 10ms is enough. BTW how did you test it?

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

/hold

wait for addressing comment

@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 Dec 18, 2024
Copy link

codecov bot commented Dec 18, 2024

Codecov Report

Attention: Patch coverage is 81.81818% with 2 lines in your changes missing coverage. Please review.

Project coverage is 75.2163%. Comparing base (0be1983) to head (dad7401).
Report is 17 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #58386        +/-   ##
================================================
+ Coverage   73.1936%   75.2163%   +2.0227%     
================================================
  Files          1681       1726        +45     
  Lines        463050     472913      +9863     
================================================
+ Hits         338923     355708     +16785     
+ Misses       103344      95076      -8268     
- Partials      20783      22129      +1346     
Flag Coverage Δ
integration 49.2799% <0.0000%> (?)
unit 72.5919% <81.8181%> (+0.2721%) ⬆️

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

Components Coverage Δ
dumpling 52.6910% <ø> (ø)
parser ∅ <ø> (∅)
br 62.1193% <ø> (+16.0993%) ⬆️

Copy link

ti-chi-bot bot commented Dec 18, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lance6716, tiancaiamao

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 Dec 18, 2024
Copy link

ti-chi-bot bot commented Dec 18, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-12-18 09:51:34.082326305 +0000 UTC m=+1036884.171128849: ☑️ agreed by lance6716.
  • 2024-12-18 11:14:57.306220851 +0000 UTC m=+1041887.395023406: ☑️ agreed by tiancaiamao.

@Rustin170506
Copy link
Member Author

/test all

@Rustin170506
Copy link
Member Author

not sure if 10 * 10ms is enough. BTW how did you test it?

Tested with the case from the issue.

image

@Rustin170506
Copy link
Member Author

/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 Dec 19, 2024
@Rustin170506
Copy link
Member Author

/retest

3 similar comments
@Rustin170506
Copy link
Member Author

/retest

@Rustin170506
Copy link
Member Author

/retest

@Rustin170506
Copy link
Member Author

/retest

@Rustin170506
Copy link
Member Author

/retest

@ti-chi-bot ti-chi-bot bot merged commit 1bf4bf1 into pingcap:master Dec 19, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved component/ddl This issue is related to DDL of TiDB. lgtm 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot make more than 1000 schema change in the test Add and drop index 1000 times, DDL hang
3 participants