Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Kim <[email protected]>
  • Loading branch information
joshua-kim committed Sep 25, 2024
1 parent 6a8cfbb commit 133354b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions x/sync/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,14 +370,14 @@ func (m *Manager) requestChangeProof(ctx context.Context, work *workItem) {
}

onResponse := func(ctx context.Context, _ ids.NodeID, responseBytes []byte, err error) {
defer m.finishWorkItem()

if err := m.handleChangeProofResponse(ctx, targetRootID, work, request, responseBytes, err); err != nil {
// TODO log responses
m.config.Log.Debug("dropping response", zap.Error(err), zap.Stringer("request", request))
m.retryWork(work)
return
}

m.finishWorkItem()
}

if err := m.sendRequest(ctx, m.config.ChangeProofClient, requestBytes, onResponse); err != nil {
Expand Down Expand Up @@ -428,14 +428,14 @@ func (m *Manager) requestRangeProof(ctx context.Context, work *workItem) {
}

onResponse := func(ctx context.Context, _ ids.NodeID, responseBytes []byte, appErr error) {
defer m.finishWorkItem()

if err := m.handleRangeProofResponse(ctx, targetRootID, work, request, responseBytes, appErr); err != nil {
// TODO log responses
m.config.Log.Debug("dropping response", zap.Error(err), zap.Stringer("request", request))
m.retryWork(work)
return
}

m.finishWorkItem()
}

if err := m.sendRequest(ctx, m.config.RangeProofClient, requestBytes, onResponse); err != nil {
Expand Down Expand Up @@ -467,6 +467,7 @@ func (m *Manager) retryWork(work *workItem) {

m.workLock.Lock()
m.unprocessedWork.Insert(work)
m.processingWorkItems--
m.workLock.Unlock()
m.unprocessedWorkCond.Signal()
}
Expand Down

0 comments on commit 133354b

Please sign in to comment.