When I click "stop" importing images, the button spins for minutes

Bug #2057690 reported by Jacopo Rota
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Triaged
Medium
Unassigned
maas-ui
Triaged
Medium
Unassigned

Bug Description

In 3.5.0, when I click "stop" importing images the button spins for many many minutes with no indication of what's happening. I've been waiting for more than 15 minutes before getting the UI responsive again.
See the screenshot attached

On the backend side, temporal is reporting

```
Cancel Request Sent
The request to cancel this Workflow Execution has been sent. If the Workflow uses the cancellation API, it'll cancel at the next available opportunity.
```
on the workflow. It took 15 minutes before the workflow was actually cancelled.

I don't think it's a problem that we don't cancel the workflow immidiately, but rather that the UI is synchronously waiting for something

Tags: ui
Revision history for this message
Jacopo Rota (r00ta) wrote :
Changed in maas-ui:
milestone: none → 3.5.0
Changed in maas:
importance: Undecided → Medium
Changed in maas-ui:
importance: Undecided → Medium
status: New → Triaged
Jacopo Rota (r00ta)
description: updated
Changed in maas-ui:
assignee: nobody → Peter Makowski (petermakowski)
Revision history for this message
Peter Makowski (petermakowski) wrote :

To clarify, currently the front-end uses two pieces of information to determine whether an import (and cancellation) is running or not:

- The `downloading` boolean on each individual boot resource
- The result of the `boot_resource.stop_import` WebSocket call

As far as I'm aware, there isn't a definitive way to determine if a cancellation operation is already in progress. What we should really do is persistently track the state of a cancellation operation on the backend, and surface that state to the UI via WebSocket so that it survives page refreshes. E.g. Something like `cancellation_in_progress` or similar returned as part of the boot resources poll message.

What I also noticed is, we do not use the `region_import_running` or `rack_import_running` booleans that are returned by the API. Do you happen to know how these "import running" flags behave when a stop is requested? Are they updated right away, or only once the workflow was actually cancelled (which, as you said, could take 15+ minutes)?

Assuming that's the case, as a temporary solution, we could optimistically update UI to "import stopped" state as soon as a user clicks on the button and stop request is sent, even before any results are returned. This will allow users to continue interacting with the part of the UI that's blocked (Update resources button). But this will only work if resource updates considered a valid operation in case cancellation is still in progress, which I'm not sure of.

Changed in maas:
milestone: 3.5.0 → 3.5.x
Changed in maas-ui:
milestone: 3.5.0 → 3.5.x
assignee: Peter Makowski (petermakowski) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.