go-ceph
go-ceph copied to clipboard
Make rgw / s3 connectionTimeout configurable
https://github.com/ceph/go-ceph/blob/10ec36044b4418394997ac8f6a90d2d19278d6f5/rgw/admin/radosgw.go#L20
When performing certain admin operations such as fetching bucket stats for users with many buckets, the timeout is too low.
WARNING[2024-10-22 16:53:45] Warning: Unable to list buckets for uid user-foo : Get "https://objects.example.com/admin/bucket?format=json&stats=true&uid=user-foo" context deadline exceeded (Client.Timeout exceeded while awaiting headers)
@norrland Seems like you want to pass a configured http.Client to the New function with the timeout you desire. The returned API will only use that default 3 second timeout if you pass a nil value.
// RGW admin API with timeout of 30 seconds
api := admin.New("my-endpoint", "the-access-key", "the-secret-key", &http.Client{Timeout: 30 * time.Second})
@Dennis-D-Allen you are correct, that solution works.