canonical / lxd

Powerful system container and virtual machine manager
https://canonical.com/lxd
GNU Affero General Public License v3.0
4.37k stars 930 forks source link

Synchronous storage volume API endpoints may result in blocking server operations #12637

Open mas-who opened 11 months ago

mas-who commented 11 months ago

Required information

Issue description

The api endpoints for updating a volume PUT /1.0/storage-pools/{poolName}/volumes/{type}/{volumeName} and updating a volume snapshot PUT /1.0/storage-pools/{poolName}/volumes/{type}/{volumeName}/snapshots/{snapshotName} are synchronous at the moment. Making a request to either endpoint results in the below successful response:

{
  type: "sync",
  status: "Success",
  status_code: 200,
  operation: "",
  error_code: 0,
  error: "",
  metadata: {},
}

This seems to be inconsistent with other API endpoints which typically results in asynchronous operations. This is concerning since it may result in long and blocking operations on the server. Suggestion is to make these endpoints asynchronous.

tomponline commented 9 months ago

@MusicDin this has been reported from our LXD UI team so would be good to take a look and evaluate.

tomponline commented 9 months ago

@MusicDin please can you look at this one as your next bug, as if we need to change the API behaviour to make it consistent then we need to do so before LXD 5.21 LTS is released.