Skip to content

Commit 9de4d01

Browse files
craig[bot]yuzefovich
andcommitted
Merge #151447
151447: colexecerror: improve BenchmarkSQLCatchVectorizedRuntimeError r=yuzefovich a=yuzefovich Previously, this benchmark when run with `conns=50` parameter would often hit errors seemingly due to port exhaustion. This was the case since the benchmark opens a ton of connections, but they would only be closed on the server shutdown. This commit fixes that issue by explicitly closing the connection from each worker goroutine once the worker is done with it. Additionally, it reduces the conns parameters from 20 and 50 to 8 and 32 in order to speed up the benchmark overall (total time on gceworker went down from 375s to 231s). Fixes: #124021. Fixes: #151297. Release note: None Co-authored-by: Yahor Yuzefovich <[email protected]>
2 parents 9ffa0d1 + 1c5782e commit 9de4d01

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/sql/colexecerror/error_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ func BenchmarkSQLCatchVectorizedRuntimeError(b *testing.B) {
184184
// crdb_test-build behavior.
185185
defer colexecerror.ProductionBehaviorForTests()()
186186

187-
for _, parallelism := range []int{1, 20, 50} {
187+
for _, parallelism := range []int{1, 8, 32} {
188188
numConns := runtime.GOMAXPROCS(0) * parallelism
189189
b.Run(fmt.Sprintf("conns=%d", numConns), func(b *testing.B) {
190190
for _, tc := range cases {
@@ -209,6 +209,7 @@ func BenchmarkSQLCatchVectorizedRuntimeError(b *testing.B) {
209209
var conn *gosql.DB
210210
select {
211211
case conn = <-conns:
212+
defer conn.Close()
212213
default:
213214
b.Fatal("not enough warm connections")
214215
}

0 commit comments

Comments
 (0)