mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-08 01:58:34 +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() {
|
func initPool() {
|
||||||
pool := conc.NewPool[any](
|
initOnce.Do(func() {
|
||||||
hardware.GetCPUNum(),
|
pool := conc.NewPool[any](
|
||||||
conc.WithPreAlloc(false),
|
hardware.GetCPUNum(),
|
||||||
conc.WithDisablePurge(false),
|
conc.WithPreAlloc(false),
|
||||||
conc.WithPreHandler(runtime.LockOSThread), // lock os thread for cgo thread disposal
|
conc.WithDisablePurge(false),
|
||||||
)
|
conc.WithPreHandler(runtime.LockOSThread), // lock os thread for cgo thread disposal
|
||||||
|
)
|
||||||
|
|
||||||
kafkaCPool.Store(pool)
|
kafkaCPool.Store(pool)
|
||||||
log.Info("init dynamicPool done", zap.Int("size", hardware.GetCPUNum()))
|
log.Info("init dynamicPool done", zap.Int("size", hardware.GetCPUNum()))
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetSQPool returns the singleton pool instance for search/query operations.
|
// GetSQPool returns the singleton pool instance for search/query operations.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user