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

The error message is not user-friendly enough - panic: failed to connect to database when loading data #169

Open
Yui-Song opened this issue Sep 5, 2023 · 0 comments
Assignees

Comments

@Yui-Song
Copy link
Collaborator

Yui-Song commented Sep 5, 2023

The error message is misleading and not user-friendly enough to show why the program gets panic.

# go-tpc tpcc --host xxx.xxx.xxx.xxx -P4000 --warehouses 1000 run -D tpcc -T 200 --time 10m0s --ignore-error --conn-params="kv_read_timeout=1000"
panic: failed to connect to database when loading data

goroutine 1 [running]:
github.com/pingcap/go-tpc/tpcc.NewWorkloader(0x0, 0x10b08e0, 0x1b, 0x1b, 0x1a, 0xc000104380)
        /go/src/github.com/pingcap/go-tpc/tpcc/workload.go:105 +0xbb3
main.executeTpcc(0xac5e7a, 0x3)
        /go/src/github.com/pingcap/go-tpc/cmd/go-tpc/tpcc.go:56 +0x36c
main.registerTpcc.func2(0xc000456dc0, 0xc00022fa00, 0x0, 0xd)
        /go/src/github.com/pingcap/go-tpc/cmd/go-tpc/tpcc.go:102 +0x36
github.com/spf13/cobra.(*Command).execute(0xc000456dc0, 0xc00022f930, 0xd, 0xd, 0xc000456dc0, 0xc00022f930)
        /go/pkg/mod/github.com/spf13/[email protected]/command.go:846 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0xc0004562c0, 0xb0cdb0, 0xc000400720, 0xc000418760)
        /go/pkg/mod/github.com/spf13/[email protected]/command.go:950 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
        /go/pkg/mod/github.com/spf13/[email protected]/command.go:887
main.main()
        /go/src/github.com/pingcap/go-tpc/cmd/go-tpc/main.go:153 +0x9db

The root cause of the panic:

# mysql -h xxx.xxx.xxx.xxx -P4000
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MySQL connection id is 687
Server version: 5.7.25-TiDB-v6.5.0 TiDB Server (Apache License 2.0) Community Edition, MySQL 5.7 compatible

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MySQL [(none)]> set @@kv_read_timeout=1000;
ERROR 1193 (HY000): Unknown system variable 'kv_read_timeout'

Another example: https://asktug.com/t/topic/1000741

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants