Skip to content
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

Handle upload exceptions allowing --retries to work properly #3558

Merged
merged 0 commits into from
Oct 25, 2022

Conversation

mhuth
Copy link
Contributor

@mhuth mhuth commented Oct 18, 2022

Signed-off-by: Mark Huth [email protected]

All Pull Requests:

Check all that apply:

  • Have you followed the guidelines in our Contributing document, including the instructions about commit messages?
  • Is this PR to correct an issue?
  • Is this PR an enhancement?

This is to fix https://bugzilla.redhat.com/show_bug.cgi?id=2117686

The insights-core connection.py._http_request() code doesn't handle network exceptions. Callers of this function just get status_codes containing errors rather than any network exception handling. This PR catches network exceptions in the _http_request() method and raises them up the call stack until they are caught in the client.py.upload() and _legacy_upload() functions. This allows the --retries option to work correctly because before, --retries didn't work if there was a network exception.

@mhuth mhuth self-assigned this Oct 18, 2022
@mhuth mhuth requested review from ahitacat, strider and Glutexo October 18, 2022 07:58
@mhuth mhuth added the client These issues represent work to be done by the "client" team. label Oct 18, 2022
@mhuth
Copy link
Contributor Author

mhuth commented Oct 18, 2022

Logs with --retries 3 and network exceptions (disabled the NIC in the VM):
Screenshot from 2022-10-18 18-39-03

@mhuth mhuth force-pushed the network_exceptions_retries_take2 branch from 596e6c1 to 93b141e Compare October 18, 2022 21:01
Copy link
Contributor

@ahitacat ahitacat left a comment

Choose a reason for hiding this comment

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

This LGTM good job I have some questions about the test that I want to @Glutexo to take a look at them.

@mhuth mhuth force-pushed the network_exceptions_retries_take2 branch 2 times, most recently from 89a8fe7 to 4048c28 Compare October 20, 2022 20:16
@mhuth mhuth requested a review from ahitacat October 20, 2022 20:19
Copy link
Contributor

@ahitacat ahitacat left a comment

Choose a reason for hiding this comment

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

🦭

@mhuth
Copy link
Contributor Author

mhuth commented Oct 21, 2022

seal

Thanks for the review/approval @ahitacat . Unfortunately I don't have permissions to merge this PR. Are you able to do that? Thanks.

@ahitacat
Copy link
Contributor

seal

Thanks for the review/approval @ahitacat . Unfortunately I don't have permissions to merge this PR. Are you able to do that? Thanks.

No, I don't have that power

@xiangce xiangce merged commit d0dc83c into master Oct 25, 2022
@xiangce xiangce deleted the network_exceptions_retries_take2 branch October 25, 2022 01:21
xiangce pushed a commit that referenced this pull request Oct 25, 2022
xiangce pushed a commit that referenced this pull request Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client These issues represent work to be done by the "client" team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants