Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
wenyihu6 committed Sep 9, 2024
1 parent cc3a302 commit 319a4b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 4 additions & 3 deletions pkg/kv/kvserver/rangefeed/buffered_sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,10 @@ func NewBufferedSender(
// SendBuffered buffers the event before sending them to the underlying
// ServerStreamSender.
//
// alloc.Release is nil-safe. SendBuffered will take the ownership of the alloc
// and release it if the return error is non-nil. Note that it is safe to send
// error events without being blocked for too long.
// alloc.Release is nil-safe. SendBuffered will take the ownership of the alloc.
// It is responsible for using if the return error is nil and releasing the
// token in the end. Note that it is safe to send error events here without
// being worried about getting blocked for too long.
func (bs *BufferedSender) SendBuffered(
ev *kvpb.MuxRangeFeedEvent, alloc *SharedBudgetAllocation,
) (err error) {
Expand Down
3 changes: 0 additions & 3 deletions pkg/kv/kvserver/rangefeed/unbuffered_registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,6 @@ func (ubr *unbufferedRegistration) publishCatchUpBuffer(ctx context.Context) err
ubr.metrics.RangefeedCatachUpBufDrainingNanos.Inc(timeutil.Since(start).Nanoseconds())
}()

ubr.mu.Lock()
defer ubr.mu.Unlock()

// TODO(wenyihu6): check if we can just drain without holding the lock first
// during reviews We shouldn't be reading from the buffer at the same time
publish := func() error {
Expand Down

0 comments on commit 319a4b5

Please sign in to comment.