Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Fix retry mechanism not sending body if first request fails before reading the body #150

Merged
merged 8 commits into from
May 12, 2023

Commits on May 11, 2023

  1. Add regression test for retries with empty body

    Signed-off-by: Leandro López (inkel) <leandro.lopez@grafana.com>
    inkel committed May 11, 2023
    Configuration menu
    Copy the full SHA
    4d9aeb6 View commit details
    Browse the repository at this point in the history
  2. Read request body on first try

    Even if successful by always reading the body we can make certain that
    the body will be sent to the server, even if the request fails before
    reading the body. See parent commit for further reference.
    
    Signed-off-by: Leandro López (inkel) <leandro.lopez@grafana.com>
    inkel committed May 11, 2023
    Configuration menu
    Copy the full SHA
    3e5bd17 View commit details
    Browse the repository at this point in the history
  3. Add RetryTimeout to configuration

    Signed-off-by: Leandro López (inkel) <leandro.lopez@grafana.com>
    inkel committed May 11, 2023
    Configuration menu
    Copy the full SHA
    7967b4b View commit details
    Browse the repository at this point in the history
  4. Fix linters

    Signed-off-by: Leandro López (inkel) <leandro.lopez@grafana.com>
    inkel committed May 11, 2023
    Configuration menu
    Copy the full SHA
    35980b7 View commit details
    Browse the repository at this point in the history
  5. Pass slice of bytes instead of io.Reader in Client.request

    Signed-off-by: Leandro López (inkel) <leandro.lopez@grafana.com>
    inkel committed May 11, 2023
    Configuration menu
    Copy the full SHA
    0945c55 View commit details
    Browse the repository at this point in the history

Commits on May 12, 2023

  1. Use ioutil.ReadAll instead of io.ReadAll

    We are declaring Go 1.14 for this library, so the new io.ReadAll
    function doesn't exist (yet).
    
    Signed-off-by: Leandro López (inkel) <leandro.lopez@grafana.com>
    inkel committed May 12, 2023
    Configuration menu
    Copy the full SHA
    0dc1db5 View commit details
    Browse the repository at this point in the history
  2. Make golangci-lint happy

    Never versions of golangci-lint will complain about this and we'll
    need to revert this commit.
    
    Signed-off-by: Leandro López (inkel) <leandro.lopez@grafana.com>
    inkel committed May 12, 2023
    Configuration menu
    Copy the full SHA
    271195b View commit details
    Browse the repository at this point in the history
  3. Update test comment

    Co-authored-by: Julien Duchesne <julien.duchesne@grafana.com>
    inkel and julienduchesne authored May 12, 2023
    Configuration menu
    Copy the full SHA
    09a55c8 View commit details
    Browse the repository at this point in the history