Skip to content

Commit

Permalink
Add backoff in TransferQueueProcessor readTransferTasks (cadence-work…
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamer Eldeeb authored Aug 24, 2017
1 parent df9ac3e commit 37a6a24
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions service/history/transferQueueProcessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -849,12 +849,19 @@ func (a *ackManager) readTransferTasks() ([]*persistence.TransferTaskInfo, error
a.RLock()
rLevel := a.readLevel
a.RUnlock()
response, err := a.executionMgr.GetTransferTasks(&persistence.GetTransferTasksRequest{
ReadLevel: rLevel,
MaxReadLevel: a.shard.GetTransferMaxReadLevel(),
BatchSize: a.processor.config.TransferTaskBatchSize,
})

var response *persistence.GetTransferTasksResponse
op := func() error {
var err error
response, err = a.executionMgr.GetTransferTasks(&persistence.GetTransferTasksRequest{
ReadLevel: rLevel,
MaxReadLevel: a.shard.GetTransferMaxReadLevel(),
BatchSize: a.processor.config.TransferTaskBatchSize,
})
return err
}

err := backoff.Retry(op, persistenceOperationRetryPolicy, common.IsPersistenceTransientError)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 37a6a24

Please sign in to comment.