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: replace fsnotify with reloading config file periodically #475

Merged
merged 3 commits into from
Feb 20, 2024

Conversation

djshow832
Copy link
Collaborator

What problem does this PR solve?

Issue Number: close #468

Problem Summary:
When the watched directory is removed and recreated immediately, sometimes fsnotify doesn't report an error and TiProxy is not aware of file change.

What is changed and how it works:
Simply reload the file periodically and set config if the file content changes.

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.

- Fix the bug that the config file may not be reloaded if the directory is removed and recreated immediately.

@ti-chi-bot ti-chi-bot bot requested review from bb7133 and xhebox February 20, 2024 08:43
@ti-chi-bot ti-chi-bot bot added the size/XL label Feb 20, 2024
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

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

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #475   +/-   ##
=======================================
  Coverage        ?   64.00%           
=======================================
  Files           ?       61           
  Lines           ?     5671           
  Branches        ?        0           
=======================================
  Hits            ?     3630           
  Misses          ?     1755           
  Partials        ?      286           
Flag Coverage Δ
unit 64.00% <100.00%> (?)

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.

Copy link

ti-chi-bot bot commented Feb 20, 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

@ti-chi-bot ti-chi-bot bot added the lgtm label Feb 20, 2024
Copy link

ti-chi-bot bot commented Feb 20, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-02-20 09:44:50.251278901 +0000 UTC m=+350378.998902012: ☑️ agreed by xhebox.

@ti-chi-bot ti-chi-bot bot added the approved label Feb 20, 2024
@ti-chi-bot ti-chi-bot bot merged commit 7443ce6 into pingcap:main Feb 20, 2024
5 checks passed
@djshow832 djshow832 deleted the fix_filepath branch February 20, 2024 09:57
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 failed
3 participants