From a76ca2235349c678c381f71d0c4e8fe8870bf3de Mon Sep 17 00:00:00 2001 From: Chris Townsend Date: Fri, 30 Oct 2020 09:43:18 -0400 Subject: [PATCH] [lxd] Add 60 seconds timeout for state operations If no timeout is set, LXD uses a hardcoded 30 second timeout when waiting on operations to complete and if the wait timeout occurs, it can lead to incorrect behavior in the LXD backend. Fixes #1777 --- src/platform/backends/lxd/lxd_virtual_machine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/backends/lxd/lxd_virtual_machine.cpp b/src/platform/backends/lxd/lxd_virtual_machine.cpp index d80e95bd83..7813cef603 100644 --- a/src/platform/backends/lxd/lxd_virtual_machine.cpp +++ b/src/platform/backends/lxd/lxd_virtual_machine.cpp @@ -356,7 +356,7 @@ const QUrl mp::LXDVirtualMachine::network_leases_url() void mp::LXDVirtualMachine::request_state(const QString& new_state) { - const QJsonObject state_json{{"action", new_state}}; + const QJsonObject state_json{{"action", new_state}, {"timeout", 60}}; auto state_task = lxd_request(manager, "PUT", state_url(), state_json, 5000);