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

playground: don't get Pid() when there is no Process #1933

Merged
merged 4 commits into from
Jun 20, 2022

Conversation

dveeden
Copy link
Contributor

@dveeden dveeden commented Jun 20, 2022

What problem does this PR solve?

Closes #1932

> main.(*Playground).terminate() ./components/playground/playground.go:990 (hits goroutine(1):1 total:1) (PC: 0x150724e)
   985:	
   986:		if p.grafana != nil {
   987:			go kill("grafana", p.grafana.cmd.Process.Pid, p.grafana.wait)
   988:		}
   989:		for _, inst := range p.tiflashs {
=> 990:			fmt.Printf("inst: %-v\n", inst.Pid())
   991:			kill(inst.Component(), inst.Pid(), inst.Wait)
   992:		}
   993:		for _, inst := range p.ticdcs {
   994:			kill(inst.Component(), inst.Pid(), inst.Wait)
   995:		}
(dlv) p inst
*github.com/pingcap/tiup/components/playground/instance.TiFlashInstance {
	instance: github.com/pingcap/tiup/components/playground/instance.instance {
		ID: 0,
		Dir: "/home/dvaneeden/.tiup/data/T9HJm1o/tiflash-0",
		Host: "127.0.0.1",
		Port: 8123,
		StatusPort: 8234,
		ConfigPath: "",
		BinPath: "",},
	TCPPort: 9000,
	ServicePort: 3930,
	ProxyPort: 20170,
	ProxyStatusPort: 20292,
	ProxyConfigPath: "",
	pds: []*github.com/pingcap/tiup/components/playground/instance.PDInstance len: 1, cap: 1, [
		*(*"github.com/pingcap/tiup/components/playground/instance.PDInstance")(0xc000200b40),
	],
	dbs: []*github.com/pingcap/tiup/components/playground/instance.TiDBInstance len: 1, cap: 1, [
		*(*"github.com/pingcap/tiup/components/playground/instance.TiDBInstance")(0xc000172d80),
	],
	Process: github.com/pingcap/tiup/components/playground/instance.Process nil,}

What is changed and how it works?

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Related changes

  • Need to cherry-pick to the release branch

Release notes:

Playground no longer panics when trying to stop processes that don't actually exist

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jun 20, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • AstroProfundis

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 20, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jun 20, 2022

Codecov Report

Merging #1933 (b5422cf) into master (44a1257) will decrease coverage by 31.42%.
The diff coverage is 0.00%.

❗ Current head b5422cf differs from pull request most recent head 452ea85. Consider uploading reports for the commit 452ea85 to get more accurate results

@@             Coverage Diff             @@
##           master    #1933       +/-   ##
===========================================
- Coverage   52.44%   21.02%   -31.42%     
===========================================
  Files         307      237       -70     
  Lines       35532    29981     -5551     
===========================================
- Hits        18633     6303    -12330     
- Misses      14703    23074     +8371     
+ Partials     2196      604     -1592     
Flag Coverage Δ
cluster ?
dm ?
playground ?
tiup ?
unittest 21.02% <0.00%> (-<0.01%) ⬇️

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

Impacted Files Coverage Δ
components/playground/playground.go 0.00% <0.00%> (-49.48%) ⬇️
main.go 0.00% <0.00%> (-100.00%) ⬇️
pkg/meta/paths.go 0.00% <0.00%> (-100.00%) ⬇️
components/dm/main.go 0.00% <0.00%> (-100.00%) ⬇️
components/cluster/main.go 0.00% <0.00%> (-100.00%) ⬇️
pkg/cluster/task/builder.go 0.00% <0.00%> (-100.00%) ⬇️
components/dm/spec/bindversion.go 0.00% <0.00%> (-100.00%) ⬇️
pkg/cluster/template/scripts/scripts.go 0.00% <0.00%> (-100.00%) ⬇️
components/dm/spec/cluster.go 0.00% <0.00%> (-91.67%) ⬇️
pkg/cluster/spec/bindversion.go 0.00% <0.00%> (-90.91%) ⬇️
... and 251 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 919c6dc...452ea85. Read the comment docs.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 20, 2022
@AstroProfundis
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: b5422cf

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 20, 2022
@ti-chi-bot
Copy link
Member

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/S Denotes a PR that changes 10-29 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

playground panics when starting with invalid version
5 participants