Add admin info timeouts (#20249)

Since a lot of operations load from storage, do remote calls, add a 10 second timeout to each operation.

This should make `mc admin info` return values even under extreme conditions.
This commit is contained in:
Klaus Post
2024-08-12 10:24:29 -07:00
committed by GitHub
parent d8f0e0ea6e
commit 53eb7656de
2 changed files with 14 additions and 3 deletions

View File

@@ -1099,6 +1099,8 @@ func (sys *NotificationSys) ServerInfo(ctx context.Context, metrics bool) []madm
wg.Add(1)
go func(client *peerRESTClient, idx int) {
defer wg.Done()
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
defer cancel()
info, err := client.ServerInfo(ctx, metrics)
if err != nil {
info.Endpoint = client.host.String()