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

ttl: fix the timezone issue and panic in the caller of getSession #58166

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

YangKeao
Copy link
Member

What problem does this PR solve?

Issue Number: close #58107, close #58109

It fixes two issues:

  1. The caller of getSession() may panic, because the getSession() may return nil, nil.
  2. The timezone of the now in rescheduleJobs is incorrect.

What changed and how does it work?

  1. Remove the nowInGlobalTZ in rescheduleJobs. It's introduced in https://github.com/pingcap/tidb/pull/51863/files#diff-9053b8d1ea0965da6e623343fd8fa0706cf9fc01a327e70a00aa7d7ae376177eR568, but I don't know why. It seems that the timeutil.WithinDayTimePeriod will set location to UTC instantly.
  2. Replace a err = to err := in getSession()

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.

Release note

None

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 11, 2024
@YangKeao YangKeao force-pushed the fix-58107-and-58109 branch from 7390ce4 to 6b96e28 Compare December 11, 2024 08:22
@YangKeao YangKeao requested a review from lcwangchao December 11, 2024 08:23
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Dec 11, 2024
@YangKeao YangKeao requested a review from Defined2014 December 11, 2024 08:43
Copy link

ti-chi-bot bot commented Dec 11, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Defined2014, lcwangchao

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:
  • OWNERS [Defined2014,lcwangchao]

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

ti-chi-bot bot commented Dec 11, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-12-11 08:39:29.52504098 +0000 UTC m=+427759.613843522: ☑️ agreed by lcwangchao.
  • 2024-12-11 08:50:48.992193214 +0000 UTC m=+428439.080995758: ☑️ agreed by Defined2014.

Copy link

codecov bot commented Dec 11, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 73.5913%. Comparing base (0ffac36) to head (60f398a).
Report is 194 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #58166        +/-   ##
================================================
+ Coverage   73.1496%   73.5913%   +0.4417%     
================================================
  Files          1675       1675                
  Lines        461848     463644      +1796     
================================================
+ Hits         337840     341202      +3362     
+ Misses       103258     101654      -1604     
- Partials      20750      20788        +38     
Flag Coverage Δ
integration 43.1806% <50.0000%> (?)
unit 72.3721% <50.0000%> (+0.0912%) ⬆️

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

Components Coverage Δ
dumpling 52.6910% <ø> (ø)
parser ∅ <ø> (∅)
br 45.4877% <ø> (-0.4986%) ⬇️

@hawkingrei
Copy link
Member

/retest

Copy link

tiprow bot commented Dec 11, 2024

@YangKeao: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
fast_test_tiprow 60f398a link true /test fast_test_tiprow

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@ti-chi-bot ti-chi-bot bot merged commit 7ac73e9 into pingcap:master Dec 11, 2024
23 of 24 checks passed
@YangKeao YangKeao added the needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. label Jan 6, 2025
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jan 6, 2025
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.5: #58709.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
5 participants