mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
Fix ticker leakage in datanode flowgraph (#16346)
Using in case ticker need to be closed may cause leakage Use time.NewTicker with deferred Stop instead Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
parent
e9090a62ab
commit
6111dcde52
@ -73,10 +73,11 @@ func (mt *mergedTimeTickerSender) bufferTs(ts Timestamp, segmentIDs []int64) {
|
||||
func (mt *mergedTimeTickerSender) tick() {
|
||||
defer mt.wg.Done()
|
||||
// this duration might be configuable in the future
|
||||
t := time.Tick(time.Millisecond * 100) // 100 millisecond, 1/2 of rootcoord timetick duration
|
||||
t := time.NewTicker(time.Millisecond * 100) // 100 millisecond, 1/2 of rootcoord timetick duration
|
||||
defer t.Stop()
|
||||
for {
|
||||
select {
|
||||
case <-t:
|
||||
case <-t.C:
|
||||
mt.cond.L.Lock()
|
||||
mt.cond.Signal() // allow worker to check every 0.1s
|
||||
mt.cond.L.Unlock()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user