Skip to content
Snippets Groups Projects
Commit a6442cb6 authored by xige-16's avatar xige-16 Committed by yefu.chen
Browse files

Fix querynode memory leak


Signed-off-by: default avatarxige-16 <xi.ge@zilliz.com>
parent 7b71b7e9
No related branches found
No related tags found
No related merge requests found
......@@ -246,7 +246,7 @@ func (ibNode *insertBufferNode) Operate(in []*Msg) []*Msg {
var offset int
for _, blob := range msg.RowData {
bv := blob.GetValue()[pos+offset : pos+(dim/8)]
bv := blob.GetValue()[pos : pos+(dim/8)]
fieldData.Data = append(fieldData.Data, bv...)
offset = len(bv)
}
......
......@@ -436,6 +436,11 @@ func (s *Segment) segmentLoadFieldData(fieldID int64, rowCount int, data interfa
return emptyErr
}
dataPointer = unsafe.Pointer(&d[0])
case []byte:
if len(d) <= 0 {
return emptyErr
}
dataPointer = unsafe.Pointer(&d[0])
case []int8:
if len(d) <= 0 {
return emptyErr
......
......@@ -7,6 +7,7 @@ import (
"strconv"
"sync"
"sync/atomic"
"time"
nodeclient "github.com/zilliztech/milvus-distributed/internal/distributed/querynode/client"
"github.com/zilliztech/milvus-distributed/internal/errors"
......@@ -16,6 +17,7 @@ import (
"github.com/zilliztech/milvus-distributed/internal/proto/internalpb2"
"github.com/zilliztech/milvus-distributed/internal/proto/milvuspb"
"github.com/zilliztech/milvus-distributed/internal/proto/querypb"
"github.com/zilliztech/milvus-distributed/internal/util/retry"
)
type MasterServiceInterface interface {
......@@ -541,7 +543,11 @@ func (qs *QueryService) CreateQueryChannel() (*querypb.CreateQueryChannelRespons
fmt.Println("query service create query channel, queryChannelName = ", allocatedQueryChannel)
for nodeID, node := range qs.queryNodes {
fmt.Println("node ", nodeID, " watch query channel")
_, err := node.AddQueryChannel(addQueryChannelsRequest)
fn := func() error {
_, err := node.AddQueryChannel(addQueryChannelsRequest)
return err
}
err := retry.Retry(10, time.Millisecond*200, fn)
if err != nil {
qs.qcMutex.Unlock()
return &querypb.CreateQueryChannelResponse{
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment