aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/vminfo/syscalls.go
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2025-01-30 15:25:31 +0100
committerAleksandr Nogikh <nogikh@google.com>2025-02-03 16:09:45 +0000
commit8f276ef29583e363bb886170f2f424f2d2a0e244 (patch)
treed37104b5067213b6058b7e588a3fc61b049b8c7f /pkg/vminfo/syscalls.go
parent52e7ad470cd3623478252840dce6484603ef1cf4 (diff)
pkg/vminfo: gracefully handle context abortion
On context abortion, return a special error. On the pkg/rpcserver side, recognize and process it.
Diffstat (limited to 'pkg/vminfo/syscalls.go')
-rw-r--r--pkg/vminfo/syscalls.go5
1 files changed, 4 insertions, 1 deletions
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)
}