When I click "stop" importing images, the button spins for minutes
Bug #2057690 reported by
Jacopo Rota
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Triaged
|
Medium
|
Unassigned | ||
3.5 |
Won't Fix
|
Medium
|
Unassigned | ||
3.6 |
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
description: | updated |
Changed in maas-ui: | |
assignee: | nobody → Peter Makowski (petermakowski) |
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 |
Changed in maas-ui: | |
milestone: | 3.5.x → 3.6.x |
To post a comment you must log in.
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 stop_import` WebSocket call
- The result of the `boot_resource.
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.