Skip to content

Add ChunkedEncodingError to list of retryable exceptions #1974

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

Sineaggi
Copy link

We've been seeing ChunkedEncodingErrors recently as well, I've added them to the list of retryable exceptions.

...
  File redacted.py
    return typing.cast(GitlabProject, project_manager.get(project_id))
  File "/usr/local/lib/python3.10/site-packages/gitlab/v4/objects/projects.py", line 816, in get
    return cast(Project, super().get(id=id, lazy=lazy, **kwargs))
  File "/usr/local/lib/python3.10/site-packages/gitlab/exceptions.py", line 311, in wrapped_f
    return f(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/gitlab/mixins.py", line 111, in get
    server_data = self.gitlab.http_get(path, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/gitlab/client.py", line 761, in http_get
    result = self.http_request(
  File "/usr/local/lib/python3.10/site-packages/gitlab/client.py", line 680, in http_request
    result = self.session.request(
  File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 529, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 687, in send
    r.content
  File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 838, in content
    self._content = b''.join(self.iter_content(CONTENT_CHUNK_SIZE)) or b''
  File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 763, in generate
    raise ChunkedEncodingError(e)
requests.exceptions.ChunkedEncodingError: ("Connection broken: InvalidChunkLength(got length b'', 0 bytes read)", InvalidChunkLength(got length b'', 0 bytes read))

@Sineaggi Sineaggi force-pushed the add-chunked-to-list-of-retryable-exceptions branch from 8244282 to a746eed Compare April 11, 2022 18:59
@codecov-commenter
Copy link

codecov-commenter commented Apr 11, 2022

Codecov Report

Merging #1974 (8256aff) into main (5370979) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1974   +/-   ##
=======================================
  Coverage   92.56%   92.56%           
=======================================
  Files          78       78           
  Lines        4910     4910           
=======================================
  Hits         4545     4545           
  Misses        365      365           
Flag Coverage Δ
cli_func_v4 81.58% <0.00%> (ø)
py_func_v4 80.12% <0.00%> (ø)
unit 83.48% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
gitlab/client.py 90.56% <100.00%> (ø)

@Sineaggi Sineaggi force-pushed the add-chunked-to-list-of-retryable-exceptions branch from a746eed to 8256aff Compare April 11, 2022 19:37
Copy link
Member

@nejch nejch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the addition again @Sineaggi - just a small suggestion.

Let's see if we need to change this in the future, ChunkedEncodingError seems very specific but I see upstream discussions on this in https://gitlab.com/gitlab-org/gitlab/-/issues/260310. So it could be the same - did you experience it with job logs?

@Sineaggi Sineaggi force-pushed the add-chunked-to-list-of-retryable-exceptions branch 2 times, most recently from 7183898 to 9f2066c Compare April 13, 2022 19:22
@Sineaggi
Copy link
Author

did you experience it with job logs?

No we're actually just seeing it with normal get project / update approval rule calls.

@Sineaggi Sineaggi force-pushed the add-chunked-to-list-of-retryable-exceptions branch 2 times, most recently from 472a19b to b0f717c Compare April 13, 2022 19:41
@Sineaggi Sineaggi force-pushed the add-chunked-to-list-of-retryable-exceptions branch from b0f717c to 7beb20f Compare April 13, 2022 19:46
@Sineaggi Sineaggi requested a review from nejch April 13, 2022 20:05
@nejch nejch merged commit 07a16af into python-gitlab:main Apr 14, 2022
@Sineaggi Sineaggi deleted the add-chunked-to-list-of-retryable-exceptions branch April 14, 2022 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants