3

SWF documentation suggests "Workers should set their client side socket timeout to at least 70 seconds (10 seconds higher than the maximum time service may hold the poll request)."

For the time being my works receive readtimeouts such as:

botocore.vendored.requests.packages.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='swf.eu-west-1.amazonaws.com', port=443): Read timed out. (read timeout=60)

I've already set

socket.setdefaulttimeout(70) 

, but it doesn't seem to produce any effect. I see that DEFAULT_TIMEOUT is set to 60 on botocore enrpoint.py , but find no way to customize this in boto3. How can I move it to 70 to avoid readtimeouts on the long polls ?

user2123288
  • 1,103
  • 1
  • 13
  • 22

2 Answers2

7

you can setup the client like this:

from boto3.session import Session
from botocore.client import Config

session = Session(aws_access_key_id=aws_id,
                  aws_secret_access_key=aws_secret,
                  region_name=region)
config = Config(connect_timeout=50, read_timeout=70)
client = session.client('swf', config=config)
AntonioD
  • 547
  • 2
  • 7
0

I'm having the same problem and got an answer on github:

There's no config option for this currently. Marking this as a feature request.

So currently setting DEFAULT_TIMEOUT = 70in botocore endpoint.py seems to be the only workaround.

Anne M.
  • 171
  • 4