Boto3 timeout 60s on SWF
The SWF documentation suggests that "Workers should set the client-side socket timeout to at least 70 seconds (10 seconds higher than the maximum time service can hold a poll request).
My works are currently receiving read requests 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 have already installed
socket.setdefaulttimeout(70)
but that doesn't seem to have any effect. I see that DEFAULT_TIMEOUT is set to 60 on botocore enrpoint.py but can't find a way to set it up in boto3. How can I move it to 70 to avoid poll duration on long polls?
+3
source to share
2 answers
you can configure 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)
+6
source to share