From 6a8cfbb48a325c1d2de2474eaee49906d2cce4d7 Mon Sep 17 00:00:00 2001 From: Joshua Kim <20001595+joshua-kim@users.noreply.github.com> Date: Wed, 25 Sep 2024 16:58:57 -0400 Subject: [PATCH] Revert "fix bug in sync retries" This reverts commit 854577f47e9fc1f03b6cabbc30386e5dfd2087a2. --- x/sync/manager.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/x/sync/manager.go b/x/sync/manager.go index 49693d23793c..ddcdc1637088 100644 --- a/x/sync/manager.go +++ b/x/sync/manager.go @@ -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 { @@ -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 {