go-ceph icon indicating copy to clipboard operation
go-ceph copied to clipboard

Make rgw / s3 connectionTimeout configurable

Open norrland opened this issue 2 years ago • 2 comments

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 avatar Oct 23 '24 07:10 norrland

@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 avatar Jan 07 '25 14:01 Dennis-D-Allen

@Dennis-D-Allen you are correct, that solution works.

norrland avatar Jan 10 '25 09:01 norrland