Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

boto3's 60s timeout on SWF

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 ?


1 Answers

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)
like image 152
AntonioD Avatar answered Nov 29 '25 23:11

AntonioD



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!