Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Regression in max_retries usage on GetSerialPortOutput() #1243

Copy link
Copy link
Closed
@same-id

Description

@same-id
Issue body actions

After v2.0.2, max_retries is ignored in GetSerialPortOutput().
This previously worked on v1.12.8.

All our tests are failing since they used this feature of the python library.

I traced the problem to this commit:

#1116 and #1117

c6912836 - fix: handle error on service not enabled (#1117)

1117 changed the default reason to be error.status which is PERMISSION_DENIAD instead using error.errors[0].reason which is rateLimitExceeded and therefore later ignored in:

# Only retry on rate limit related failures.
if reason in ("userRateLimitExceeded", "rateLimitExceeded"):
    return True

Example for such json:

{'error': {'code': 403,
           'errors': [{'domain': 'usageLimits',
                       'message': 'Quota exceeded for quota group '
                                  "'GetSerialPortOutputGroup' and limit "
                                  "'Instance GetSerialPortOutput requests per "
                                  "user per 100 seconds' of service "
                                  "'compute.googleapis.com' for consumer "
                                  "'project_number:REDACTED'.",
                       'reason': 'rateLimitExceeded'}],
           'message': 'Quota exceeded for quota group '
                      "'GetSerialPortOutputGroup' and limit 'Instance "
                      "GetSerialPortOutput requests per user per 100 seconds' "
                      "of service 'compute.googleapis.com' for consumer "
                      "'project_number:REDACTED'.",
           'status': 'PERMISSION_DENIED'}}

I think that correct fix for #1117 should not have changed the order of lookup - first check for error.errors[0].reason and if it doesn't exist fallback to error.status

Sam

Metadata

Metadata

Assignees

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.type: docsImprovement to the documentation for an API.Improvement to the documentation for an API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.