Skip to content

Commit

Permalink
Address the comment
Browse files Browse the repository at this point in the history
Signed-off-by: JmPotato <[email protected]>
  • Loading branch information
JmPotato committed Nov 11, 2024
1 parent d98cf59 commit 0accfcb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client/tso_dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func newTSODispatcher(
New: func() any {
return newBatchController[*tsoRequest](
maxBatchSize*2,
tsoRequestFinisherFactory(0, 0, 0, invalidStreamID),
tsoRequestFinisher(0, 0, 0, invalidStreamID),
tsoBestBatchSize,
)
},
Expand Down Expand Up @@ -614,7 +614,7 @@ func (td *tsoDispatcher) processRequests(
return nil
}

func tsoRequestFinisherFactory(physical, firstLogical int64, suffixBits uint32, streamID string) finisherFunc[*tsoRequest] {
func tsoRequestFinisher(physical, firstLogical int64, suffixBits uint32, streamID string) finisherFunc[*tsoRequest] {
return func(idx int, tsoReq *tsoRequest, err error) {
// Retrieve the request context before the request is done to trace without race.
requestCtx := tsoReq.requestCtx
Expand All @@ -627,12 +627,12 @@ func tsoRequestFinisherFactory(physical, firstLogical int64, suffixBits uint32,

func (td *tsoDispatcher) cancelCollectedRequests(tbc *batchController[*tsoRequest], streamID string, err error) {
td.tokenCh <- struct{}{}
tbc.finishCollectedRequests(tsoRequestFinisherFactory(0, 0, 0, streamID), err)
tbc.finishCollectedRequests(tsoRequestFinisher(0, 0, 0, streamID), err)
}

func (td *tsoDispatcher) doneCollectedRequests(tbc *batchController[*tsoRequest], physical, firstLogical int64, suffixBits uint32, streamID string) {
td.tokenCh <- struct{}{}
tbc.finishCollectedRequests(tsoRequestFinisherFactory(physical, firstLogical, suffixBits, streamID), nil)
tbc.finishCollectedRequests(tsoRequestFinisher(physical, firstLogical, suffixBits, streamID), nil)
}

// checkMonotonicity checks whether the monotonicity of the TSO allocation is violated.
Expand Down

0 comments on commit 0accfcb

Please sign in to comment.