使用零字节源对象的 PUT 对象副本有时会挂起
适用场景
StorageGRID 11.4
问题描述
- 如果CopyObject源对象为零字节,则 S3 API 失败。
- CopyObject通过 cURL 发出时冻结,不显示错误弹出窗口:
$
 ...
 curl -iksS -X PUT <url>/<destination-bucket>/<zero-byte-object-copy> -H content-length:0 -H x-amz-content-sha256:<content-sha256> -H x-amz-copy-source:/<source-bucket>/<zero-byte-object> -H x-amz-date:<YYYYmmddTHHMMSSZ> -H Authorization:AWS4-HMAC-SHA256 Credential=<credential>,SignedHeaders=<headers>,Signature=<signature>
 ^C << command hangs and is aborted manually
 $
- CopyObjectAWS 命令行发出失败并显示错误- Read timeout on endpoint URL:
$ aws s3api --debug --endpoint-url <url> --no-verify-ssl copy-object --bucket <destination-bucket> --key <zero-byte-object-copy> --copy-source /<source-bucket>/<zero-byte-object>
 ...
 Read timeout on endpoint URL:
 "<url>/<destination-bucket>/<zero-byte-object-copy>"
 $
- CopyObject成功处理非零字节源对象。
- 发出 s3 cp将零字节文件复制到其他名称的命令Read timed out时出错:
DEBUG - retry needed, retryable exception caught: HTTPSConnectionPool(host='hostname', port=xxx): Read timed out. (read timeout=xx)