通话时
response = kinesis.describe_stream(StreamName='xxx')
可能有点过于频繁,使用LimitExceededException
的HTTP400响应。意外的部分是botocore retryhandler认为这不需要重试
2018-11-14 13:51:02,771 urllib3.connectionpool [DEBUG] https://kinesis.us-east-1.amazonaws.com:443 "POST / HTTP/1.1" 400 122
2018-11-14 13:51:02,771 botocore.parsers [DEBUG] Response headers: {'x-amzn-RequestId': 'd2203136-53db-60ba-8646-41e0ed56783e', 'x-amz-id-2': 'xxxx', 'connection': 'close', 'Date': 'Wed, 14 Nov 2018 18:51:02 GMT', 'Content-Type': 'application/x-amz-json-1.1', 'Content-Length': '122'}
2018-11-14 13:51:02,771 botocore.parsers [DEBUG] Response body:
b'{"__type":"LimitExceededException","message":"Rate exceeded for stream xxxx under account xxxx"}'
2018-11-14 13:51:02,772 botocore.hooks [DEBUG] Event needs-retry.kinesis.DescribeStream: calling handler <botocore.retryhandler.RetryHandler object at 0x10aa4e940>
2018-11-14 13:51:02,772 botocore.retryhandler [DEBUG] No retry needed.
即使http状态代码,服务错误代码和操作与此处的策略匹配,也是如此: https://github.com/boto/botocore/blob/1.12.4/botocore/data/_retry.json#L174-L181
如果我将175行更改为__default__
,则会发生重试,尽管这可能是不希望的,因为它会捕获其他操作。我对DescribeStream的重试方式有何期望?