mirror of https://github.com/milvus-io/milvus.git
Set timeout for leader observer syncing (#27504)
Signed-off-by: yah01 <yah2er0ne@outlook.com>pull/27531/head
parent
fc429cabba
commit
a715165306
|
@ -31,6 +31,7 @@ import (
|
|||
"github.com/milvus-io/milvus/internal/querycoordv2/utils"
|
||||
"github.com/milvus-io/milvus/pkg/log"
|
||||
"github.com/milvus-io/milvus/pkg/util/commonpbutil"
|
||||
"github.com/milvus-io/milvus/pkg/util/paramtable"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -281,6 +282,8 @@ func (o *LeaderObserver) sync(ctx context.Context, replicaID int64, leaderView *
|
|||
},
|
||||
Version: time.Now().UnixNano(),
|
||||
}
|
||||
ctx, cancel := context.WithTimeout(ctx, paramtable.Get().QueryCoordCfg.SegmentTaskTimeout.GetAsDuration(time.Millisecond))
|
||||
defer cancel()
|
||||
resp, err := o.cluster.SyncDistribution(ctx, leaderView.ID, req)
|
||||
if err != nil {
|
||||
log.Warn("failed to sync distribution", zap.Error(err))
|
||||
|
|
Loading…
Reference in New Issue