You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, can you fix the formatting of the issue description and provide some more details on what issue you're experiencing and when? Perhaps some sample code? It will make investigating this issue easier. Thanks!
Observed
This causes blocking when clickhouse does not return
goroutine 226 [select, 2740 minutes]:
github.com/ClickHouse/clickhouse-go/v2.(*rows).Next(0xc000b5ef60)
/eadpdata/data/eadp/jenkins-slave-new/workspace/server_example/service/vendor/github.com/ClickHouse/clickhouse-go/v2/clickhouse_rows.go:52 +0x14c
github.com/ClickHouse/clickhouse-go/v2.(*stdRows).Next(0xc001a3d9c0, {0xc00137ad20, 0xa, 0x1a0?})
/eadpdata/data/eadp/jenkins-slave-new/workspace/server_example/service/vendor/github.com/ClickHouse/clickhouse-go/v2/clickhouse_std.go:425 +0x59
database/sql.(*Rows).nextLocked(0xc000fc7290)
/usr/local/go/src/database/sql/sql.go:3047 +0x107
database/sql.(*Rows).Next.func1()
/usr/local/go/src/database/sql/sql.go:3022 +0x29
database/sql.withLock({0x16ee650, 0xc000fc72c8}, 0xc0014e4808)
/usr/local/go/src/database/sql/sql.go:3530 +0x82
database/sql.(*Rows).Next(0xc000fc7290)
/usr/local/go/src/database/sql/sql.go:3021 +0x85
gorm.io/gorm.Scan({0x16fbac8, 0xc000fc7290}, 0xc0018d2870, 0x0)
/eadpdata/data/eadp/jenkins-slave-new/workspace/server_example/service/vendor/gorm.io/gorm/scan.go:290 +0xd7f
gorm.io/gorm/callbacks.Query(0xc0018d2870)
/eadpdata/data/eadp/jenkins-slave-new/workspace/server_example/service/vendor/gorm.io/gorm/callbacks/query.go:27 +0x105
gorm.io/gorm.(*processor).Execute(0xc0006bdb30, 0xc0005f73b0?)
/eadpdata/data/eadp/jenkins-slave-new/workspace/server_example/service/vendor/gorm.io/gorm/callbacks.go:130 +0x3cc
gorm.io/gorm.(*DB).Find(0xc000914200?, {0xc000914200, 0xc001b0a318}, {0x0, 0x0, 0x0})
/eadpdata/data/eadp/jenkins-slave-new/workspace/server_example/service/vendor/gorm.io/gorm/finisher_api.go:170 +0x134
config-server/store/byconity.(*Store).GetAll(0xc00073dbd0, {0x14b6542, 0x23}, 0xc000b5ec60, {0x0, 0x0, 0x0})
/eadpdata/data/eadp/jenkins-slave-new/workspace/server_example/service/store/byconity/byconity.go:342 +0x40d
config-server/manager/config.(*ConfigManager).getAllCommandConfigs(0x149f964?, {0xc1daeb0cb360d760, 0x668262ea22f25, 0x22453e0})
/eadpdata/data/eadp/jenkins-slave-new/workspace/server_example/service/manager/config/agent_operator.go:346 +0x306
config-server/manager/config.(*ConfigManager).updateAgentCommandOnce(0xc0008ae000, {0xc1daeb0cb360d760, 0x668262ea22f25, 0x22453e0})
/eadpdata/data/eadp/jenkins-slave-new/workspace/server_example/service/manager/config/agent_operator.go:281 +0x175
config-server/manager/config.(*ConfigManager).updatePeriodically(0xc0008ae000, 0xc000b4a060, 0x1, 0xc000b50010, {0x14a0f49, 0x14})
/eadpdata/data/eadp/jenkins-slave-new/workspace/server_example/service/manager/config/agent_operator.go:63 +0x245
created by config-server/manager/config.(*ConfigManager).UpdateAgentCommandToLocal in goroutine 1
/eadpdata/data/eadp/jenkins-slave-new/workspace/server_example/service/manager/config/agent_operator.go:101 +0xcc
Expected behaviour
Code example
Before:
func (r *rows) Next() (result bool) {
defer func() {
if !result {
r.Close()
}
}()
if r.block == nil {
return false
}
next:
if r.row >= r.block.Rows() {
if r.stream == nil {
return false
}
select {
case err := <-r.errors:
if err != nil {
r.err = err
return false
}
case block := <-r.stream:
if block == nil {
return false
}
if block.Packet == proto.ServerTotals {
r.row, r.block, r.totals = 0, nil, block
return false
}
r.row, r.block = 0, block
}
goto next
}
r.row++
return r.row <= r.block.Rows()
}
After:
func (r *rows) Next() (result bool) {
defer func() {
if !result {
r.Close()
}
}()
if r.block == nil {
return false
}
next:
if r.row >= r.block.Rows() {
if r.stream == nil {
return false
}
select {
case err := <-r.errors:
if err != nil {
r.err = err
return false
}
case block := <-r.stream:
if block == nil {
return false
}
if block.Packet == proto.ServerTotals {
r.row, r.block, r.totals = 0, nil, block
return false
}
r.row, r.block = 0, block
case <-time.After(time.Second * 60):
r.err = fmt.Errorf("timeout waiting for next block")
return false
}
goto next
}
r.row++
return r.row <= r.block.Rows()
}
The text was updated successfully, but these errors were encountered: