Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Enable cancelation of stuck "in progress" mass firmware updates #208

Open
tricksol opened this issue Nov 15, 2022 · 3 comments
Open
Labels
enhancement New feature or request

Comments

@tricksol
Copy link

On the mass update history tab where you see the running updates, there should be a button to cancel updates that seem to be stuck.

@nemesifier nemesifier added the enhancement New feature or request label Nov 22, 2022
@kosli
Copy link
Contributor

kosli commented Jan 22, 2023

I have run into the same "issue" :-)

@nemesifier
Copy link
Member

nemesifier commented Jun 9, 2023

This is a rare corner case which shouldn't happen thanks to OPENWISP_FIRMWARE_UPGRADER_TASK_TIMEOUT (see relevant section in the readme).

It can happen though, if while an upgrade is in progress, a cold shut down is performed.

Now, how can we deal with this is the question.

Allow canceling or abort an in-progress upgrade can create other problems and more corner cases to handle.
The upgrade can be canceled if the firmware is not being flashed yet, but once the flashing starts, there's no point in aborting, it's too late.

I think the problem here is that while an upgrade is in progress users cannot do new upgrades, which is very annoying.
A quick fix is to open the django shell and execute this SQL query, just make sure there's no other real upgrade in progress!

UpgradeOperation.objects.filter(status='in-progress').update(status='failed')

A definitive solution could be the following: when a new upgraded operation is created if we detect another one in progress, let's check if it's old enough to be timed out, if it is we assume this corner case is happening, flag it as failed automatically and move on.

Now, I cannot promise we'll invest our resources in fixing this since we can easily work around it with 1 minute and it never happens to the OpenWISP instances we manage, but if anyone wants to contribute, feel free to implement this solution and send a patch.

@ghost
Copy link

ghost commented Jun 9, 2023

Hey, I opened a draft PR, haven't tested it yet though as I don't have my env set up. https://github.com/openwisp/openwisp-firmware-upgrader/pull/238/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging a pull request may close this issue.

3 participants