Skip to content

Conversation

@bnemanich
Copy link
Contributor

I needed to enable retries for a 500 error code. When testing this out, it appeared that retries weren't being done for any error codes, so I added the default codes that urllib3 normally retries on. I also found that if the retry limit had been reached, conda would crash with an unhandled exception. This was solved by adding the raise_on_status flag.

This was tested using the following web serving script to return errors:

from http.server import BaseHTTPRequestHandler

class ErrorHandler(BaseHTTPRequestHandler):
    
    def do_GET(self):
        self.send_error(500)
        return

if __name__ == '__main__':
    from http.server import HTTPServer
    server = HTTPServer(('localhost', 8090), ErrorHandler)
    print("Starting server, use <Ctrl-C> to stop")
    server.serve_forever()

Once the web server was running, the following command was used to test the retry capabilities:
conda install -c "http://localhost:8090" conda

bnemanich added 2 commits May 5, 2020 15:04
Also, properly handles the case where retries all fail.
@bnemanich bnemanich requested a review from a team as a code owner May 5, 2020 20:26
@cla-bot
Copy link

cla-bot bot commented May 5, 2020

We require contributors to sign our Contributor License Agreement, and we don't have one on file for @bnemanich. In order for us to review and merge your code, please e-sign the PDF at https://conda.io/en/latest/contributing.html#conda-contributor-license-agreement. We then need to manually verify your signature. We will ping the bot to refresh the PR status when we have confirmed your signature.

@cla-bot
Copy link

cla-bot bot commented May 5, 2020

We require contributors to sign our Contributor License Agreement, and we don't have one on file for @bnemanich. In order for us to review and merge your code, please e-sign the PDF at https://conda.io/en/latest/contributing.html#conda-contributor-license-agreement. We then need to manually verify your signature. We will ping the bot to refresh the PR status when we have confirmed your signature.

@jjhelmus
Copy link
Contributor

@cla-bot check

@cla-bot cla-bot bot added the cla-signed [bot] added once the contributor has signed the CLA label May 15, 2020
@cla-bot
Copy link

cla-bot bot commented May 15, 2020

The cla-bot has been summoned, and re-checked this pull request!

@bnemanich
Copy link
Contributor Author

@jjhelmus Do you have any opinions on this PR?

Copy link
Contributor

@mcg1969 mcg1969 left a comment

Choose a reason for hiding this comment

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

This makes good sense. Thank you!

@mcg1969 mcg1969 merged commit 3527c89 into conda:master Jul 15, 2020
@github-actions
Copy link

Hi there, thank you for your contribution to Conda!

This pull request has been automatically locked since it has not had recent activity after it was closed.

Please open a new issue or pull request if needed.

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Aug 20, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed [bot] added once the contributor has signed the CLA locked [bot] locked due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants