Skip to content

Commit

Permalink
Fix misc copylocks and remove exclude rule (milvus-io#22962)
Browse files Browse the repository at this point in the history
Signed-off-by: Congqi Xia <[email protected]>
  • Loading branch information
congqixia authored Mar 24, 2023
1 parent 52f4de3 commit 8f84788
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 12 deletions.
2 changes: 0 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ issues:
- G307
# Use of weak random number generator math/rand
- G404
# Exclude copylocks
- copylocks
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
max-issues-per-linter: 0
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
Expand Down
6 changes: 3 additions & 3 deletions cmd/tools/config/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ type DocContent struct {
}

func collect() []DocContent {
params := paramtable.ComponentParam{}
params := &paramtable.ComponentParam{}
params.Init()

val := reflect.ValueOf(params)
val := reflect.ValueOf(params).Elem()
data := make([]DocContent, 0)
keySet := typeutil.NewSet[string]()
for i := 0; i < val.NumField(); i++ {
valueField := val.Field(i)
collectRecursive(&params, &data, &valueField)
collectRecursive(params, &data, &valueField)
}
result := make([]DocContent, 0)
for _, d := range data {
Expand Down
2 changes: 1 addition & 1 deletion internal/datanode/flow_graph_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func TestFlowGraphManager(t *testing.T) {
const channelPrefix = "by-dev-rootcoord-dml-test-fg-mgr-execute-"
for _, test := range tests {
t.Run(test.testName, func(t *testing.T) {
var baseParams = Params.BaseTable
var baseParams = &Params.BaseTable
baseParams.Save(Params.DataNodeCfg.MemoryWatermark.Key, fmt.Sprintf("%f", test.watermark))
for i, memorySize := range test.memorySizes {
vchannel := fmt.Sprintf("%s%d", channelPrefix, i)
Expand Down
2 changes: 1 addition & 1 deletion internal/datanode/segment_sync_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func TestSyncMemoryTooHigh(t *testing.T) {

for _, test := range tests {
t.Run(test.testName, func(t *testing.T) {
var baseParams = Params.BaseTable
var baseParams = &Params.BaseTable
baseParams.Save(Params.DataNodeCfg.MemoryForceSyncSegmentNum.Key, fmt.Sprintf("%d", test.syncSegmentNum))
policy := syncMemoryTooHigh()
segments := make([]*Segment, len(test.memorySizesInMB))
Expand Down
2 changes: 1 addition & 1 deletion internal/distributed/connection_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ type testIndexNode struct {
}

func initSession(ctx context.Context) *sessionutil.Session {
baseTable := paramtable.Get().BaseTable
baseTable := &paramtable.Get().BaseTable
rootPath, err := baseTable.Load("etcd.rootPath")
if err != nil {
panic(err)
Expand Down
4 changes: 2 additions & 2 deletions internal/indexnode/indexnode_component_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

type mockIndexNodeComponent struct {
IndexNode
*IndexNode
}

var _ types.IndexNodeComponent = &mockIndexNodeComponent{}
Expand Down Expand Up @@ -36,6 +36,6 @@ func NewMockIndexNodeComponent(ctx context.Context) (types.IndexNodeComponent, e
return nil, err
}
return &mockIndexNodeComponent{
IndexNode: *node,
IndexNode: node,
}, nil
}
4 changes: 2 additions & 2 deletions internal/mq/msgstream/mq_msgstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ var _ MsgStream = (*MqTtMsgStream)(nil)

// MqTtMsgStream is a msgstream that contains timeticks
type MqTtMsgStream struct {
mqMsgStream
*mqMsgStream
chanMsgBuf map[mqwrapper.Consumer][]TsMsg
chanMsgPos map[mqwrapper.Consumer]*msgpb.MsgPosition
chanStopChan map[mqwrapper.Consumer]chan bool
Expand Down Expand Up @@ -473,7 +473,7 @@ func NewMqTtMsgStream(ctx context.Context,
syncConsumer := make(chan int, 1)

return &MqTtMsgStream{
mqMsgStream: *msgStream,
mqMsgStream: msgStream,
chanMsgBuf: chanMsgBuf,
chanMsgPos: chanMsgPos,
chanStopChan: chanStopChan,
Expand Down

0 comments on commit 8f84788

Please sign in to comment.