From 8f276ef29583e363bb886170f2f424f2d2a0e244 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Thu, 30 Jan 2025 15:25:31 +0100 Subject: pkg/vminfo: gracefully handle context abortion On context abortion, return a special error. On the pkg/rpcserver side, recognize and process it. --- pkg/vminfo/syscalls.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pkg/vminfo/syscalls.go') diff --git a/pkg/vminfo/syscalls.go b/pkg/vminfo/syscalls.go index 9793cfee8..f4a6919a5 100644 --- a/pkg/vminfo/syscalls.go +++ b/pkg/vminfo/syscalls.go @@ -115,7 +115,10 @@ func (ctx *checkContext) do(fileInfos []*flatrpc.FileInfo, featureInfos []*flatr globs := make(map[string][]string) for _, req := range globReqs { res := req.Wait(ctx.ctx) - if res.Status != queue.Success { + if res.Err == queue.ErrRequestAborted { + // Don't return an error on context cancellation. + return nil, nil, nil, nil + } else if res.Status != queue.Success { return nil, nil, nil, fmt.Errorf("failed to execute glob: %w (%v)\n%s\n%s", res.Err, res.Status, req.GlobPattern, res.Output) } -- cgit mrf-deployment