From 2a072579c23ad348a87d3f46f959c8d58b3fdd33 Mon Sep 17 00:00:00 2001 From: Mark Laing Date: Fri, 8 Dec 2023 10:00:21 +0000 Subject: [PATCH] [lxd-import] client: Always use event listener for operations. When long polling the operation wait endpoint, we can never guarantee that the request will not time out for very long operations (e.g. an exec session) because intermediate proxies or load balancers may timeout the request if there is no activity. This commit changes the `useEventListener` argument to getOperations to true for all requests. Regardless of whether the `operation_wait` API extension is present. Signed-off-by: Mark Laing --- client/incus_instances.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/incus_instances.go b/client/incus_instances.go index 0a14e3f3b45..f173ed53821 100644 --- a/client/incus_instances.go +++ b/client/incus_instances.go @@ -1112,8 +1112,7 @@ func (r *ProtocolIncus) ExecInstance(instanceName string, exec api.InstanceExecP } // Send the request - useEventListener := r.CheckExtension("operation_wait") != nil - op, _, err := r.queryOperation("POST", uri, exec, "", useEventListener) + op, _, err := r.queryOperation("POST", uri, exec, "", true) if err != nil { return nil, err }