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

config: revert to watch config file and fix the concurrency issue #446

Merged
merged 3 commits into from
Jan 4, 2024

Conversation

djshow832
Copy link
Collaborator

What problem does this PR solve?

Issue Number: close #444

Problem Summary:
#445 has another bug: the accuracy of file modify time is 1ms. The file may be updated twice in 1ms and TiProxy may fail to load the latest one.

What is changed and how it works:

  • Revert to the watch config file way
  • Fix the concurrency issue in this way: if there's a watch error, in the next tick, if adding the watch file succeeds, reload it.
  • Make the tick interval configurable and set it to 1s by default

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 requested review from bb7133 and xhebox January 3, 2024 12:56
@ti-chi-bot ti-chi-bot bot added the size/L label Jan 3, 2024
@ti-chi-bot ti-chi-bot bot added the lgtm label Jan 4, 2024
Copy link

ti-chi-bot bot commented Jan 4, 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 Jan 4, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-01-04 02:44:45.367202503 +0000 UTC m=+2311376.404429430: ☑️ agreed by xhebox.

@ti-chi-bot ti-chi-bot bot added the approved label Jan 4, 2024
@ti-chi-bot ti-chi-bot bot merged commit 9fd81b4 into pingcap:main Jan 4, 2024
5 checks passed
@djshow832 djshow832 deleted the revert_mod_time branch January 4, 2024 02:50
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.

TestFilePath fails
2 participants