Skip to content

RetryPolicy is broken in case of rate limiting #334

@jrmeland

Description

@jrmeland

I have the scenario where I started getting rate limited e.g. TooManyRequests

I then implemented an exponential backoff retry as described in the docs

Now I am getting the issue This operation cannot be performed after the request has been submitted

Stack trace:

This operation cannot be performed after the request has been submitted., Stack =    at System.Net.HttpWebRequest.GetResponse()
ndOrPayInvoiceBulkAsync() > at Intuit.Ipp.Core.Rest.SyncRestHandler.CallRestService(HttpWebRequest request)
ndOrPayInvoiceBulkAsync() > at Intuit.Ipp.Core.IntuitRetryPolicy.<>c__DisplayClass23_0.<ExecuteAction>b__0()
ndOrPayInvoiceBulkAsync() > at Intuit.Ipp.Core.IntuitRetryPolicy.ExecuteAction[TResult](Func`1 func)
ndOrPayInvoiceBulkAsync() > at Intuit.Ipp.Core.Rest.SyncRestHandler.GetResponse(HttpWebRequest request)
ndOrPayInvoiceBulkAsync() > at Intuit.Ipp.QueryFilter.QueryService`1.ExecuteIdsQuery(String idsQuery, QueryOperationType queryOperationType)

I am not sure if I am doing something wrong. But it seems like the retry logic is calling GetResponse multiple times on the failed request and this is causing issues. Does retries work at all? Do I need to try one of the other strategies?

Thanks!

Relevant post

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions