When a request is being cancelled by the caller via the context, even though the underlying HTTP client should not perform any more request and directly return, the backoff mechanism still kicks in and leaves the caller waiting for multiple backoff periods for nothing.
I had a look at #17 and #28 and thought that maybe this solution, that does not change the signatures and fully uses the context that callers set on the HTTP request might work.
Coverage decreased (-8.8%) to 91.247% when pulling f123478c319468f1f8d19c1a2096d5f76cb8e53d on vthiery:improve-req-cancellation into 2f1fd2700e9d549092e9c249e08be101a6a887c6 on gojek:master.
When a request is being cancelled by the caller via the context, even though the underlying HTTP client should not perform any more request and directly return, the backoff mechanism still kicks in and leaves the caller waiting for multiple backoff periods for nothing.
I had a look at #17 and #28 and thought that maybe this solution, that does not change the signatures and fully uses the context that callers set on the HTTP request might work.