Skip to content

Commit

Permalink
Revert "fix bug in sync retries"
Browse files Browse the repository at this point in the history
This reverts commit 854577f.
  • Loading branch information
joshua-kim committed Sep 25, 2024
1 parent 854577f commit 6a8cfbb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 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

0 comments on commit 6a8cfbb

Please sign in to comment.