From e7173063977b204a3efb9152836ec5e8b7646934 Mon Sep 17 00:00:00 2001 From: Arnaud Rebillout Date: Wed, 4 Feb 2026 22:32:20 +0700 Subject: [PATCH] Use a longer timeout when removing a mirror The default timeout of 10 seconds might be too short when removing a mirror, as it's a lenghty operation: mirrorbits needs to remove all the keys associated with the mirror from the database. The number of keys is roughly equal to the number of files tracked on the mirror. On the Kali mirrorbits instance we hit the timeout pretty much every time we remove a mirror. This has not always been the case, so I suppose we were close to the 10 seconds timeout, and then we crossed it (maybe the instance is more busy these days, or maybe it happened after we switched from redis to valkey). Close: #206 --- cli/commands.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/commands.go b/cli/commands.go index f05a5b0a..03a92d60 100644 --- a/cli/commands.go +++ b/cli/commands.go @@ -435,7 +435,8 @@ func (c *cli) CmdRemove(args ...string) error { } client := c.GetRPC() - ctx, cancel := context.WithTimeout(context.Background(), defaultRPCTimeout) + // Use a timeout longer than the default, removing a mirror can take time + ctx, cancel := context.WithTimeout(context.Background(), time.Second * 60) defer cancel() _, err := client.RemoveMirror(ctx, &rpc.MirrorIDRequest{ ID: int32(id),