mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 17:48:29 +08:00
fix: Move init kafka pool into once (#37786)
Introduced by #37744 Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
parent
351463b67e
commit
97b7ebbc08
@ -34,15 +34,17 @@ var (
|
||||
)
|
||||
|
||||
func initPool() {
|
||||
pool := conc.NewPool[any](
|
||||
hardware.GetCPUNum(),
|
||||
conc.WithPreAlloc(false),
|
||||
conc.WithDisablePurge(false),
|
||||
conc.WithPreHandler(runtime.LockOSThread), // lock os thread for cgo thread disposal
|
||||
)
|
||||
initOnce.Do(func() {
|
||||
pool := conc.NewPool[any](
|
||||
hardware.GetCPUNum(),
|
||||
conc.WithPreAlloc(false),
|
||||
conc.WithDisablePurge(false),
|
||||
conc.WithPreHandler(runtime.LockOSThread), // lock os thread for cgo thread disposal
|
||||
)
|
||||
|
||||
kafkaCPool.Store(pool)
|
||||
log.Info("init dynamicPool done", zap.Int("size", hardware.GetCPUNum()))
|
||||
kafkaCPool.Store(pool)
|
||||
log.Info("init dynamicPool done", zap.Int("size", hardware.GetCPUNum()))
|
||||
})
|
||||
}
|
||||
|
||||
// GetSQPool returns the singleton pool instance for search/query operations.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user