Skip to content

Conversation

ZuluPro
Copy link
Contributor

@ZuluPro ZuluPro commented Dec 23, 2017

I just experienced the following error:

File "/usr/local/lib/python2.7/dist-packages/SoftLayer/API.py", line 360, in call
    return self.client.call(self.name, name, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/SoftLayer/API.py", line 263, in call
    return self.transport(request)
  File "/usr/local/lib/python2.7/dist-packages/SoftLayer/transports.py", line 199, in __call__
    raise exceptions.TransportError(0, str(ex))
SoftLayer.exceptions.TransportError: TransportError(0): ('Connection broken: error("(104, \'ECONNRESET\')",)', error("(104, 'ECONNRESET')",))

So I though about the change the transport implementation to allow retries in case connection error.

This also create memoized session.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 86.362% when pulling 2e416b4 on ZuluPro:requests into 5f16b02 on softlayer:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 86.362% when pulling 43ea8f6 on ZuluPro:requests into 5f16b02 on softlayer:master.

@allmightyspiff
Copy link
Member

allmightyspiff commented Dec 26, 2017

I'm a little hesitant to make a library wide retry right now. I do have a @Retry decorator that I've been adding where I feel it is safe.

I will review this though to see if using the requests retry function works well. Mostly I'm concerned that this might lead to placeOrder calls putting in multiple orders in certain cases.

Also, please make sure the travis-ci build finishes successfully as well.

@ZuluPro
Copy link
Contributor Author

ZuluPro commented Dec 27, 2017

@allmightyspiff
Actually the retries are implemented only on ConnectionError.
That means it will not retry when fail to read response or with bad status code,
Only TCP Error, before HTTP ones.

@allmightyspiff
Copy link
Member

I'll merge this in #916

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