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

*: use context to manage runner #8394

Merged
merged 4 commits into from
Jul 22, 2024
Merged

Conversation

rleungx
Copy link
Member

@rleungx rleungx commented Jul 15, 2024

What problem does this PR solve?

Issue Number: ref #8386

What is changed and how does it work?

Check List

Tests

  • Unit test

Release note

None.

Signed-off-by: Ryan Leung <rleungx@gmail.com>
@ti-chi-bot ti-chi-bot bot added dco-signoff: yes Indicates the PR's author has signed the dco. release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/needs-triage-completed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 15, 2024
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jul 15, 2024
@okJiang
Copy link
Member

okJiang commented Jul 15, 2024

/test pull-integration-realcluster-test

Copy link
Contributor

ti-chi-bot bot commented Jul 15, 2024

@okJiang: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

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/test-infra repository.

Copy link

codecov bot commented Jul 15, 2024

Codecov Report

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

Project coverage is 77.15%. Comparing base (ca179e6) to head (d55b270).
Report is 17 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8394      +/-   ##
==========================================
- Coverage   77.24%   77.15%   -0.10%     
==========================================
  Files         471      471              
  Lines       61696    61700       +4     
==========================================
- Hits        47660    47607      -53     
- Misses      10454    10507      +53     
- Partials     3582     3586       +4     
Flag Coverage Δ
unittests 77.15% <88.88%> (-0.10%) ⬇️

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

@okJiang
Copy link
Member

okJiang commented Jul 16, 2024

I found lots of repeated operator logs in the test. Is this because of the content of this pr? 🤔
https://do.pingcap.net/jenkins/blue/rest/organizations/jenkins/pipelines/tikv/pipelines/pd/pipelines/pull_integration_realcluster_test/runs/312/nodes/72/steps/77/log/?start=0

[2024/07/15 17:05:31.010 +08:00] [INFO] [operator_controller.go:510] ["add operator"] [region-id=52] [operator="\"grant-leader {transfer leader: store 2 to 3} (kind:leader, region:52(23, 5), createAt:2024-07-15 17:05:31.01069943 +0800 CST m=+78.032028045, startAt:0001-01-01 00:00:00 +0000 UTC, currentStep:0, size:0, steps:[0:{transfer leader from store 2 to store 3}], timeout:[1m0s])\""] [additional-info=]
...
[2024/07/15 17:05:34.512 +08:00] [INFO] [operator_controller.go:510] ["add operator"] [region-id=52] [operator="\"grant-leader {transfer leader: store 2 to 3} (kind:leader, region:52(23, 5), createAt:2024-07-15 17:05:34.512594216 +0800 CST m=+81.533922837, startAt:0001-01-01 00:00:00 +0000 UTC, currentStep:0, size:0, steps:[0:{transfer leader from store 2 to store 3}], timeout:[1m0s])\""] [additional-info=]
...
[2024/07/15 17:05:44.517 +08:00] [INFO] [operator_controller.go:510] ["add operator"] [region-id=52] [operator="\"grant-leader {transfer leader: store 2 to 3} (kind:leader, region:52(23, 5), createAt:2024-07-15 17:05:44.517445078 +0800 CST m=+91.538773699, startAt:0001-01-01 00:00:00 +0000 UTC, currentStep:0, size:0, steps:[0:{transfer leader from store 2 to store 3}], timeout:[1m0s])\""] [additional-info=]

@rleungx
Copy link
Member Author

rleungx commented Jul 16, 2024

I found lots of repeated operator logs in the test. Is this because of the content of this pr? 🤔 https://do.pingcap.net/jenkins/blue/rest/organizations/jenkins/pipelines/tikv/pipelines/pd/pipelines/pull_integration_realcluster_test/runs/312/nodes/72/steps/77/log/?start=0

[2024/07/15 17:05:31.010 +08:00] [INFO] [operator_controller.go:510] ["add operator"] [region-id=52] [operator="\"grant-leader {transfer leader: store 2 to 3} (kind:leader, region:52(23, 5), createAt:2024-07-15 17:05:31.01069943 +0800 CST m=+78.032028045, startAt:0001-01-01 00:00:00 +0000 UTC, currentStep:0, size:0, steps:[0:{transfer leader from store 2 to store 3}], timeout:[1m0s])\""] [additional-info=]
...
[2024/07/15 17:05:34.512 +08:00] [INFO] [operator_controller.go:510] ["add operator"] [region-id=52] [operator="\"grant-leader {transfer leader: store 2 to 3} (kind:leader, region:52(23, 5), createAt:2024-07-15 17:05:34.512594216 +0800 CST m=+81.533922837, startAt:0001-01-01 00:00:00 +0000 UTC, currentStep:0, size:0, steps:[0:{transfer leader from store 2 to store 3}], timeout:[1m0s])\""] [additional-info=]
...
[2024/07/15 17:05:44.517 +08:00] [INFO] [operator_controller.go:510] ["add operator"] [region-id=52] [operator="\"grant-leader {transfer leader: store 2 to 3} (kind:leader, region:52(23, 5), createAt:2024-07-15 17:05:44.517445078 +0800 CST m=+91.538773699, startAt:0001-01-01 00:00:00 +0000 UTC, currentStep:0, size:0, steps:[0:{transfer leader from store 2 to store 3}], timeout:[1m0s])\""] [additional-info=]

I don't know the relationship between the failure test and this PR. It looks irrelevant.

@okJiang
Copy link
Member

okJiang commented Jul 16, 2024

/test pull-integration-realcluster-test

@rleungx
Copy link
Member Author

rleungx commented Jul 16, 2024

/hold

@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 Jul 16, 2024
Signed-off-by: Ryan Leung <rleungx@gmail.com>
@rleungx
Copy link
Member Author

rleungx commented Jul 16, 2024

/test pull-integration-realcluster-test

@rleungx
Copy link
Member Author

rleungx commented Jul 16, 2024

/hold cancel

@ti-chi-bot ti-chi-bot bot removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. do-not-merge/needs-triage-completed labels Jul 16, 2024
@rleungx rleungx requested a review from nolouch July 17, 2024 05:51
start := time.Now()
select {
case <-ctx.Done():
return
Copy link
Contributor

@nolouch nolouch Jul 19, 2024

Choose a reason for hiding this comment

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

I think the race problem's main reason is the task of accessing the object without protection. here still cannot avoid this kind of problem, we should let the task be safely run concurrency in task logic.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, indeed, but with the context, we can exit the goroutine ASAP.

Copy link
Contributor

Choose a reason for hiding this comment

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

actually, I think it should pass context to the task, and then the task should consider exit ASAP by context cancel. here only prevent starting the new task. the initial version has this design :)

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jul 22, 2024
Copy link
Contributor

ti-chi-bot bot commented Jul 22, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: HuSharp, nolouch, okJiang

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
Contributor

ti-chi-bot bot commented Jul 22, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-07-15 08:07:11.063529194 +0000 UTC m=+254853.054470665: ☑️ agreed by HuSharp.
  • 2024-07-22 09:53:41.700423425 +0000 UTC m=+866043.691364895: ☑️ agreed by nolouch.

Copy link
Contributor

ti-chi-bot bot commented Jul 22, 2024

@rleungx: Your PR was out of date, I have automatically updated it for you.

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

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 ti-community-infra/tichi repository.

@ti-chi-bot ti-chi-bot bot merged commit 7136d69 into tikv:master Jul 22, 2024
21 checks passed
@rleungx rleungx deleted the runner-context branch July 22, 2024 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved dco-signoff: yes Indicates the PR's author has signed the dco. 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.

4 participants