微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

将AWS cpp sdk用于Google Cloud时的卷发超时

如何解决将AWS cpp sdk用于Google Cloud时的卷发超时

我有一个安装了aws cpp sdk的Debian 9客户端。我正在将此SDK用于Google Cloud Storage。 SDK使用curl来向云发出请求。我有一个测试程序,可以对云进行大量的PUT。我观察到最初有几个PUT成功,然后开始看到PUT的卷曲超时错误。以下是来自AWS sdk的日志,它们指示curl请求超时:

[DEBUG] 2020-09-08 20:24:44.466 AWSAuthV4Signer [140206136674048] Signed Headers value:content-length;content-type;host;x-amz-content-sha256;x-amz-date
[DEBUG] 2020-09-08 20:24:44.466 AWSAuthV4Signer [140206136674048] Canonical Request String: PUT
<Objname>

content-length:2101248
content-type:binary/octet-stream
host:storage.googleapis.com
x-amz-content-sha256:UNSIGNED-PAYLOAD
x-amz-date:20200908T202444Z

content-length;content-type;host;x-amz-content-sha256;x-amz-date
UNSIGNED-PAYLOAD
[DEBUG] 2020-09-08 20:24:44.466 AWSAuthV4Signer [140206136674048] Final String to sign: AWS4-HMAC-SHA256
20200908T202444Z
20200908/us-east-1/s3/aws4_request
79a64334206d67cfc19f147fdf51caa409d39f5054ab48a7ca655d5bc3a30438
..
[DEBUG] 2020-09-08 20:24:44.466 AWSClient [140206136674048] Request Successfully signed
[DEBUG] 2020-09-08 20:24:44.466 CurlHandleContainer [140206136674048] Attempting to acquire curl connection.
[INFO] 2020-09-08 20:24:44.466 CurlHandleContainer [140206136674048] Connection has been released. Continuing.
[DEBUG] 2020-09-08 20:24:44.466 CurlHandleContainer [140206136674048] Returning connection handle 0x7f839801e740
[DEBUG] 2020-09-08 20:24:44.466 CurlHttpClient [140206136674048] Obtained connection handle 0x7f839801e740
[ERROR] 2020-09-08 20:26:44.739 CurlHttpClient [140206136674048] Curl returned error code 28 - Timeout was reached
[DEBUG] 2020-09-08 20:26:44.739 CurlHandleContainer [140206136674048] Releasing curl handle 0x7f839801e740
[DEBUG] 2020-09-08 20:26:44.739 CurlHandleContainer [140206136674048] Notified waiting threads.
[DEBUG] 2020-09-08 20:26:44.739 AWSClient [140206136674048] Request returned error. Attempting to generate appropriate error codes from response
[ERROR] 2020-09-08 20:26:44.739 AWSClient [140206136674048] HTTP response code: -1
Exception name:
Error message: Unable to connect to endpoint

我的一些观察结果

  • 我在GET上没有这个问题。
  • 我仅在使用Debian时才看到此问题。当我在Ubuntu 18.04上尝试使用主机时,它运行良好。
  • 当我使用HTTP和端口80而不是HTTPS和端口443时,我没有看到此问题。

有什么想法可能导致卷曲超时?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。