writecache: Remove usage of close channel in bbolt and badger #688
No reviewers
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#688
Loading…
Reference in a new issue
No description provided.
Delete branch "acid-ant/frostfs-node:feature/642-wc-flush-with-ctx-from-main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Close #642
Signed-off-by: Anton Nikiforov an.nikiforov@yadro.com
@ -104,2 +99,2 @@
c.runFlushLoop()
c.runGCLoop()
ctx, cancel := context.WithCancel(context.Background())
c.cancel = cancel
Not protected by
modeMtx
here as the comment says.Protected in
Close
, as it was forcloseCh
too. Thought this comment is about this.Ok, it seems
closeCh
had this problem too@ -123,3 +120,3 @@
defer c.modeMtx.Unlock()
c.closeCh = nil
c.cancel = nil
What about setting it to nil right after we called it?
Good catch, updated.
@ -36,21 +36,18 @@ const (
)
type collector struct {
cache *cache
Why this change?
Agree. I also don't understand the intention to remove these fields and pass them to
send
method. Could you explain, please?That was the previous implementation when I tried to use context from main. Also, the idea was to reduce the amount of entities. Let's revert these changes.
@ -149,2 +142,3 @@
// All calls to Send are done by a single goroutine
stream.Send = coll.Send
stream.Send = func(buf *z.Buffer) error {
return coll.send(ctx, cancel, c, buf)
Do we need this
cancel
argument, why not cancel context afterOrchestrate()
?We need to interrupt at the moment when scheduled more than
flushBatchSize
items for flush. That is why I usecancel
insideSend
.699b6a7b24
tofbfff9ef3f
fbfff9ef3f
toec46096a80
ec46096a80
to82b2bf0c4d
@ -32,3 +32,2 @@
flushCh chan *objectSDK.Object
// closeCh is close channel, protected by modeMtx.
closeCh chan struct{}
// cancel is cancel function, protected by modeMtx.
Init
is not protected by modeMtx. Comment or behaviour should be fixed.Description updated.
82b2bf0c4d
to1c6b72c7a1
1c6b72c7a1
toe306ee1b0c
e306ee1b0c
tob5df54f407
4f5f4c92f2
toe927399d50
e927399d50
todae60f7dd9
dae60f7dd9
toedb5be5ec8
edb5be5ec8
to0f4633d65d