wu-sheng commented on code in PR #153:
URL:
https://github.com/apache/skywalking-banyandb/pull/153#discussion_r941996107
##########
banyand/tsdb/index/writer.go:
##########
@@ -76,36 +77,37 @@ func NewWriter(ctx context.Context, options WriterOptions)
*Writer {
}
w.shardNum = options.ShardNum
w.db = options.DB
+ w.enableGlobalIndex = options.EnableGlobalIndex
w.indexRuleIndex = partition.ParseIndexRuleLocators(options.Families,
options.IndexRules)
- w.ch = run.NewChan[Message](make(chan Message))
+ w.ch = make(chan Message)
w.bootIndexGenerator()
return w
}
func (s *Writer) Write(value Message) {
go func(m Message) {
- s.ch.Write(m)
+ s.ch <- m
}(value)
}
func (s *Writer) Close() error {
- return s.ch.Close()
Review Comment:
Automatically closing always has this kind of bugs in GC phases.
Be careful. We don't want a leak 😄
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]