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

session, executor, domain: use the SQL start time to calculate the runaway deadline #54496

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

JmPotato
Copy link
Member

@JmPotato JmPotato commented Jul 8, 2024

What problem does this PR solve?

Issue Number: ref #54434.

What changed and how does it work?

Use the StartTime in SessionVars to calculate the runaway deadline.

Check List

Tests

  • Unit test
  • Integration test

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

Signed-off-by: JmPotato <ghzpotato@gmail.com>
@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 8, 2024
@JmPotato
Copy link
Member Author

JmPotato commented Jul 8, 2024

/cc @nolouch @hi-rustin

PTAL.

@ti-chi-bot ti-chi-bot bot requested review from Rustin170506 and nolouch July 8, 2024 08:13
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jul 8, 2024
@@ -476,7 +476,7 @@ type RunawayChecker struct {
watchAction rmpb.RunawayAction
}

func newRunawayChecker(manager *RunawayManager, resourceGroupName string, setting *rmpb.RunawaySettings, originalSQL, sqlDigest, planDigest string) *RunawayChecker {
func newRunawayChecker(manager *RunawayManager, resourceGroupName string, setting *rmpb.RunawaySettings, originalSQL, sqlDigest, planDigest string, startTime time.Time) *RunawayChecker {
Copy link
Member

Choose a reason for hiding this comment

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

seems some params passed from sessionVars, maybe directly pass the sessVars in here?

Copy link
Member Author

Choose a reason for hiding this comment

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

After testing, it appears that moving GetPlanDigest causes an import cycle. Therefore, I suggest we keep it as is for now.

@easonn7
Copy link

easonn7 commented Jul 8, 2024

/approve

@JmPotato
Copy link
Member Author

JmPotato commented Jul 8, 2024

/retest

Copy link

codecov bot commented Jul 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.0020%. Comparing base (08147e7) to head (e92cf37).
Report is 2 commits behind head on master.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #54496         +/-   ##
=================================================
- Coverage   74.7636%   56.0020%   -18.7616%     
=================================================
  Files          1542       1663        +121     
  Lines        362006     608281     +246275     
=================================================
+ Hits         270649     340650      +70001     
- Misses        71710     244269     +172559     
- Partials      19647      23362       +3715     
Flag Coverage Δ
integration 37.1340% <73.3333%> (?)
unit 71.8027% <100.0000%> (-1.8735%) ⬇️

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

Components Coverage Δ
dumpling 52.9656% <ø> (-2.2339%) ⬇️
parser ∅ <ø> (∅)
br 52.6108% <ø> (+4.9578%) ⬆️

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.

/approve

@ti-chi-bot ti-chi-bot bot added the approved label Jul 8, 2024
Copy link

tiprow bot commented Jul 8, 2024

@JmPotato: 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 e92cf37 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.

Copy link

ti-chi-bot bot commented Jul 8, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: easonn7, hi-rustin, lance6716, nolouch

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

ti-chi-bot bot commented Jul 8, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-07-08 08:22:13.808483949 +0000 UTC m=+259431.043718066: ☑️ agreed by nolouch.
  • 2024-07-08 08:58:09.128288715 +0000 UTC m=+261586.363522828: ☑️ agreed by hi-rustin.

@JmPotato
Copy link
Member Author

JmPotato commented Jul 8, 2024

/test unit-test

Copy link

tiprow bot commented Jul 8, 2024

@JmPotato: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow
  • /test tidb_parser_test

Use /test all to run all jobs.

In response to this:

/test unit-test

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.

@ti-chi-bot ti-chi-bot bot merged commit bf50430 into pingcap:master Jul 8, 2024
21 of 23 checks passed
@JmPotato JmPotato deleted the replace_time_cost branch July 8, 2024 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants