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

[Bug]: UT TestKill got error panic BUG: StartStatement called twice #16385

Closed
1 task done
xzxiong opened this issue May 24, 2024 · 1 comment
Closed
1 task done

[Bug]: UT TestKill got error panic BUG: StartStatement called twice #16385

xzxiong opened this issue May 24, 2024 · 1 comment
Assignees
Labels
kind/bug Something isn't working severity/s0 Extreme impact: Cause the application to break down and seriously affect the use
Milestone

Comments

@xzxiong
Copy link
Contributor

xzxiong commented May 24, 2024

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

main

Commit ID

f19ea2a

Other Environment Information

- Hardware parameters:
- OS type:
- Others:

Actual Behavior

GOROOT=/usr/local/go #gosetup
GOPATH=/Users/jacksonxie/go #gosetup
/usr/local/go/bin/go test -c -o /Users/jacksonxie/Library/Caches/JetBrains/GoLand2023.2/tmp/GoLand/___TestKill_in_github_com_matrixorigin_matrixone_pkg_frontend.test github.com/matrixorigin/matrixone/pkg/frontend #gosetup
/usr/local/go/bin/go tool test2json -t /Users/jacksonxie/Library/Caches/JetBrains/GoLand2023.2/tmp/GoLand/___TestKill_in_github_com_matrixorigin_matrixone_pkg_frontend.test -test.v -test.paniconexit0 -test.run ^\QTestKill\E$
2024/05/24 12:18:24 maxprocs: Leaving GOMAXPROCS=10: CPU quota undefined
=== RUN   TestKill
Server started
2024/05/24 12:18:24.183017 +0800 INFO cn-service.frontend check password succeeded {"uuid": "", "session_info": "", "session_id": "018fa8d2-4736-7933-99fd-6c1209a9c47d"}
2024/05/24 12:18:24.183281 +0800 DEBUG cn-service.frontend SWITCH ESTABLISHED to true {"uuid": "", "connection_info": "connectionId 1001|127.0.0.1:53388"}
2024/05/24 12:18:24.183292 +0800 INFO cn-service.frontend mo accept connection, time cost of Created: 306.875µs, Establish: 278.125µs, UpgradeTLS: 0s, Authenticate: 264.667µs, SendErrPacket: 0s, SendOKPacket: 23.708µs, CheckTenant: 0s, CheckUser: 0s, CheckRole: 0s, CheckDbName: 0s, InitGlobalSysVar: 0s {"uuid": "", "session_info": "", "session_id": "018fa8d2-4736-7933-99fd-6c1209a9c47d"}
2024/05/24 12:18:24.183441 +0800 INFO cn-service.frontend mo received first request {"uuid": "", "session_info": "connectionId 1001|127.0.0.1:53388|{account sys:dump: -- 0:0:0}|goRoutineId 118|018fa8d2-4736-7933-99fd-6c1209a9c47d", "session_id": "018fa8d2-4736-7933-99fd-6c1209a9c47d"}
2024/05/24 12:18:24.183573 +0800 INFO frontend/mysql_protocol_test.go:282 open conn1
2024/05/24 12:18:26.184788 +0800 INFO frontend/mysql_protocol_test.go:286 open conn1 done
2024/05/24 12:18:26.184859 +0800 INFO frontend/mysql_protocol_test.go:288 open conn2
2024/05/24 12:18:28.186851 +0800 INFO cn-service.frontend check password succeeded {"uuid": "", "session_info": "", "session_id": "018fa8d2-56da-796a-8920-762c6defa554"}
2024/05/24 12:18:28.186905 +0800 DEBUG cn-service.frontend SWITCH ESTABLISHED to true {"uuid": "", "connection_info": "connectionId 1002|127.0.0.1:53393"}
2024/05/24 12:18:28.186913 +0800 INFO cn-service.frontend mo accept connection, time cost of Created: 219.208µs, Establish: 74.125µs, UpgradeTLS: 0s, Authenticate: 60.5µs, SendErrPacket: 0s, SendOKPacket: 12.792µs, CheckTenant: 0s, CheckUser: 0s, CheckRole: 0s, CheckDbName: 0s, InitGlobalSysVar: 0s {"uuid": "", "session_info": "", "session_id": "018fa8d2-56da-796a-8920-762c6defa554"}
2024/05/24 12:18:28.186947 +0800 INFO frontend/mysql_protocol_test.go:292 open conn2 done
2024/05/24 12:18:28.186963 +0800 INFO frontend/mysql_protocol_test.go:294 get the connection id of conn1
2024/05/24 12:18:28.188811 +0800 INFO frontend/mysql_protocol_test.go:300 get the connection id of conn1 done
2024/05/24 12:18:28.188827 +0800 INFO frontend/mysql_protocol_test.go:302 get the connection id of conn2
2024/05/24 12:18:28.188888 +0800 INFO cn-service.frontend mo received first request {"uuid": "", "session_info": "connectionId 1002|127.0.0.1:53393|{account sys:dump: -- 0:0:0}|goRoutineId 146|018fa8d2-56da-796a-8920-762c6defa554", "session_id": "018fa8d2-56da-796a-8920-762c6defa554"}
2024/05/24 12:18:28.189096 +0800 INFO frontend/mysql_protocol_test.go:308 get the connection id of conn2 done
2024/05/24 12:18:28.189103 +0800 INFO frontend/mysql_protocol_test.go:309 conn==>1001 1002
2024/05/24 12:18:28.189114 +0800 INFO frontend/mysql_protocol_test.go:319 conn1 sleep(30)
2024/05/24 12:18:30.190183 +0800 INFO frontend/mysql_protocol_test.go:330 conn2 kill query on conn1
2024/05/24 12:18:30.190725 +0800 ERROR cn-service.frontend Failed to execute request {"uuid": "", "error": "internal error: panic BUG: StartStatement called twice: \ngithub.com/matrixorigin/matrixone/pkg/frontend.(*testWorkspace).StartStatement\n\t/Users/jacksonxie/go/src/github.com/matrixorigin/matrixone/pkg/frontend/txn_test.go:65\ngithub.com/matrixorigin/matrixone/pkg/frontend.executeStmtWithWorkspace\n\t/Users/jacksonxie/go/src/github.com/matrixorigin/matrixone/pkg/frontend/mysql_cmd_executor.go:2482\ngithub.com/matrixorigin/matrixone/pkg/frontend.executeStmtWithTxn\n\t/Users/jacksonxie/go/src/github.com/matrixorigin/matrixone/pkg/frontend/mysql_cmd_executor.go:2410\ngithub.com/matrixorigin/matrixone/pkg/frontend.executeStmtWithResponse\n\t/Users/jacksonxie/go/src/github.com/matrixorigin/matrixone/pkg/frontend/mysql_cmd_executor.go:2375\ngithub.com/matrixorigin/matrixone/pkg/frontend.doComQuery\n\t/Users/jacksonxie/go/src/github.com/matrixorigin/matrixone/pkg/frontend/mysql_cmd_executor.go:2933\ngithub.com/matrixorigin/matrixone/pkg/frontend.ExecRequest\n\t/Users/jacksonxie/go/src/github.com/matrixorigin/matrixone/pkg/frontend/mysql_cmd_executor.go:3009\ngithub.com/matrixorigin/matrixone/pkg/frontend.(*Routine).handleRequest\n\t/Users/jacksonxie/go/src/github.com/matrixorigin/matrixone/pkg/frontend/routine.go:287\ngithub.com/matrixorigin/matrixone/pkg/frontend.(*RoutineManager).Handler\n\t/Users/jacksonxie/go/src/github.com/matrixorigin/matrixone/pkg/frontend/routine_manager.go:520\ngithub.com/fagongzi/goetty/v2.(*server).doConnection\n\t/Users/jacksonxie/go/pkg/mod/github.com/matrixorigin/goetty/v2@v2.0.0-20231122095211-6a25dc9130ca/application.go:393\ngithub.com/fagongzi/goetty/v2.(*server).doStart.func2.1\n\t/Users/jacksonxie/go/pkg/mod/github.com/matrixorigin/goetty/v2@v2.0.0-20231122095211-6a25dc9130ca/application.go:356\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_arm64.s:1222", "session_info": "connectionId 1002|127.0.0.1:53393|{account sys:dump: -- 0:0:0}|goRoutineId 146|018fa8d2-56da-796a-8920-762c6defa554", "session_id": "018fa8d2-56da-796a-8920-762c6defa554"}
    mysql_protocol_test.go:335: 
        	Error Trace:	/Users/jacksonxie/go/src/github.com/matrixorigin/matrixone/pkg/frontend/mysql_protocol_test.go:335
        	Error:      	Received unexpected error:
        	            	Error 20101 (HY000): internal error: panic BUG: StartStatement called twice: 
        	            	github.com/matrixorigin/matrixone/pkg/frontend.(*testWorkspace).StartStatement
        	            		/Users/jacksonxie/go/src/github.com/matrixorigin/matrixone/pkg/frontend/txn_test.go:65
        	            	github.com/matrixorigin/matrixone/pkg/frontend.executeStmtWithWorkspace
        	            		/Users/jacksonxie/go/src/github.com/matrixorigin/matrixone/pkg/frontend/mysql_cmd_executor.go:2482
        	            	github.com/matrixorigin/matrixone/pkg/frontend.executeStmtWithTxn
        	            		/Users/jacksonxie/go/src/github.com/matrixorigin/matrixone/pkg/frontend/mysql_cmd_executor.go:2410
        	            	github.com/matrixorigin/matrixone/pkg/frontend.executeStmtWithResponse
        	            		/Users/jacksonxie/go/src/github.com/matrixorigin/matrixone/pkg/frontend/mysql_cmd_executor.go:2375
        	            	github.com/matrixorigin/matrixone/pkg/frontend.doComQuery
        	            		/Users/jacksonxie/go/src/github.com/matrixorigin/matrixone/pkg/frontend/mysql_cmd_executor.go:2933
        	            	github.com/matrixorigin/matrixone/pkg/frontend.ExecRequest
        	            		/Users/jacksonxie/go/src/github.com/matrixorigin/matrixone/pkg/frontend/mysql_cmd_executor.go:3009
        	            	github.com/matrixorigin/matrixone/pkg/frontend.(*Routine).handleRequest
        	            		/Users/jacksonxie/go/src/github.com/matrixorigin/matrixone/pkg/frontend/routine.go:287
        	            	github.com/matrixorigin/matrixone/pkg/frontend.(*RoutineManager).Handler
        	            		/Users/jacksonxie/go/src/github.com/matrixorigin/matrixone/pkg/frontend/routine_manager.go:520
        	            	github.com/fagongzi/goetty/v2.(*server).doConnection
        	            		/Users/jacksonxie/go/pkg/mod/github.com/matrixorigin/goetty/v2@v2.0.0-20231122095211-6a25dc9130ca/application.go:393
        	            	github.com/fagongzi/goetty/v2.(*server).doStart.func2.1
        	            		/Users/jacksonxie/go/pkg/mod/github.com/matrixorigin/goetty/v2@v2.0.0-20231122095211-6a25dc9130ca/application.go:356
        	            	runtime.goexit
        	            		/usr/local/go/src/runtime/asm_arm64.s:1222
        	Test:       	TestKill
--- FAIL: TestKill (6.11s)

FAIL

Process finished with the exit code 1

Expected Behavior

No response

Steps to Reproduce

  1. modify function getParameterUnit(...)
func getParameterUnit(configFile string, eng engine.Engine, txnClient TxnClient) (*mo_config.ParameterUnit, error) {
	sv, err := getSystemVariables(configFile)
	if err != nil {
		return nil, err
	}
+	sv.SetDefaultValues()
	pu := mo_config.NewParameterUnit(sv, eng, txnClient, engine.Nodes{})

	return pu, nil
}
  1. run ut TestKill

Additional information

No response

@xzxiong xzxiong added kind/bug Something isn't working needs-triage severity/s1 High impact: Logical errors or data errors that must occur labels May 24, 2024
@xzxiong xzxiong added this to the 1.2.1 milestone May 24, 2024
@xzxiong xzxiong self-assigned this May 24, 2024
@xzxiong xzxiong mentioned this issue May 24, 2024
7 tasks
@sukki37 sukki37 added severity/s0 Extreme impact: Cause the application to break down and seriously affect the use and removed needs-triage severity/s1 High impact: Logical errors or data errors that must occur labels May 27, 2024
@xzxiong
Copy link
Contributor Author

xzxiong commented May 28, 2024

Done.

@xzxiong xzxiong closed this as completed May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working severity/s0 Extreme impact: Cause the application to break down and seriously affect the use
Projects
None yet
Development

No branches or pull requests

2 participants