Skip to content

tiup bench panic when connect is failed #197

@JaySon-Huang

Description

@JaySon-Huang

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?

Run tiup bench tpch prepare or other bench command without valid mysql/tidb in host:port

  1. What did you expect to see?
    Report connected failed and exit with exit code != 0

  2. What did you see instead?
    panic

>  tiup bench tpch prepare
Starting component `bench`: /Users/jayson/.tiup/components/bench/v0.0.1/bench tpch prepare
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x10f59c8]

goroutine 50 [running]:
database/sql.(*Conn).close(0x0, 0x0, 0x0, 0x0, 0x0)
	/usr/local/go/src/database/sql/sql.go:1926 +0x38
database/sql.(*Conn).Close(...)
	/usr/local/go/src/database/sql/sql.go:1947
github.com/pingcap/go-tpc/tpch.Workloader.CleanupThread(0x0, 0x1a77740, 0x15cc860, 0xc000086300, 0xf)
	/go/pkg/mod/github.com/pingcap/go-tpc@v1.0.4-0.20200410025347-ee3e3247e342/tpch/workload.go:76 +0x7c
main.execute(0x15cc860, 0xc000086300, 0x15d1440, 0xc0000821e0, 0x150872b, 0x7, 0xf, 0x0, 0x0)
	/home/jenkins/agent/workspace/bench-tiup-mirror-update/components/bench/misc.go:46 +0x214
main.executeWorkload.func2(0xc000094070, 0x15cc820, 0xc0000ae0c0, 0x15d1440, 0xc0000821e0, 0x150872b, 0x7, 0xf)
	/home/jenkins/agent/workspace/bench-tiup-mirror-update/components/bench/misc.go:99 +0xc8
created by main.executeWorkload
	/home/jenkins/agent/workspace/bench-tiup-mirror-update/components/bench/misc.go:97 +0x16f
Error: run `/Users/jayson/.tiup/components/bench/v0.0.1/bench` (wd:/Users/jayson/.tiup/data/RySx8IB) failed: exit status 2
  1. What version of TiUP are you using (tiup --version)?
>  tiup --version
tiup version v0.0.5 tiup
Go Version: go1.13
Git Branch: master
GitHash: aab3add
Build Time: 2020-04-24 18:10:05 +0800

Metadata

Metadata

Assignees

No one assigned

    Labels

    status/TODOCategorizes issue as we will do it.type/bugCategorizes issue as related to a bug.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions