Skip to content

Inconsistent max_retry use in _rest_request() #191

Description

@xrg

if attempts <= self._max_retry:

This line uses self._max_retry to return the failed exception or RetriesExhaustedError while the loop in :908 uses the overriden local max_retry . I suppose this was a miss from commit 2b077fc that changed :908 but not this line.

We have an edge case, where the method is called with a different max_retry than the client default self._max_retry

  1. if max_retry < self._max_retry this will be raising the inner (eg. ConnectionRefused) exception rather than RetriesExhaustedError . Different than anticipated.
  2. if max_retry > self._max_retry and there is some 40x return while in the max_retry - self._max_retry -th attempt, instead of the 40x error we will see a [premature] RetriesExhaustedError.

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