通过流上传对象时,如何在Apache Libcloud中提供连接超时配置?

时间:2019-02-12 11:32:07

标签: python python-3.x amazon-s3 libcloud

当前,我在将文件上传到S3时遇到问题:

@FeignClient(contextId = "fooClient", name = "stores", configuration = FooConfiguration.class)
public interface FooClient {
    //..
}

@FeignClient(contextId = "barClient", name = "stores", configuration = BarConfiguration.class)
public interface BarClient {
    //..
}

我上传对象的代码是:

  File "/home/aviral/dev/versionator-athena/venv/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/home/aviral/dev/versionator-athena/venv/lib/python3.6/site-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/home/aviral/dev/versionator-athena/venv/lib/python3.6/site-packages/urllib3/util/retry.py", line 398, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='s3-ap-south-1.amazonaws.com', port=443): Max retries exceeded with url: /sc-pallet/test/temp_feb12_1525/check_pk_s3_append/version_1/version_two_million_eleven_columns.csv_insert_2?uploadId=VLzRQhq0rN1NIHJo0OCvTjbwifmHTfmPfYQZWFdxjr_7oPfC4v5ME7WC_entIDqvW9.AuY.UGQTS1fH2SdYmGCD1ieZPZ7q3Z4qdUaRUqLX2V144Gq4W3H.Ck1fH4Yrx&partNumber=1 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f6b3bedd240>: Failed to establish a new connection: [Errno 110] Connection timed out',))

由于文件很大,因此我决定通过流上传。它在这里产生了一个问题,因此我需要在上传时添加连接超时配置。

0 个答案:

没有答案