syncloud / platform

Run popular services on your device with one click
https://syncloud.org
GNU General Public License v3.0
393 stars 40 forks source link

Interrupt of long operations by concurrent user activity #582

Closed mikini closed 7 months ago

mikini commented 3 years ago

Describe the bug Performing additional concurrent HTTP requests on the Syncloud "platform" web interface after having already started a long running operation (like {,un}installation) seems to be able to somehow interrupt or at least affect the running operation.

I've observed, at least to my perception, {,un}install being aborted by such actions, and for example the issue described by #579 might potentially be caused by this. These request could be opening new browser tabs against the interface, or reloading the page from the original operation while the "busy spinnner" is showing.

Also playing a role in the user experience here is the missing indication of progress during operations (see #581) and maybe a mechanism for reporting errors encountered during operation is also missing (have not seen any at least), the only indication of success is whether the App page changes from having "Install" to "Open", "Remove" & "Backup" buttons.

To Reproduce I'm afraid I do not have logs of the scenario, and I'm not able to establish a solid reproduction test case currently as the only Syncloud system I have available is the one at the Pi which people are using.

But the general steps would be:

  1. Go to 'App Center'
  2. Click on an app
  3. Click "Install"
  4. Confirm installation by clicking "OK"
  5. See the busy spinner
  6. Reload the app installation page and/or load the UI with other browser tabs
  7. Observer Syncloud logs (are there others besides /var/log/syslog? how to enable debug logging?)
  8. Observe UI and application state

Expected behaviour Operation succeeds as it is supposed to.

Additional context My observations were done as a completely new Syncloud user on the relatively slow hardware of a Raspberry Pi 3B (boosted using force_turbo).

cyberb commented 3 years ago

Thank you for reporting this.

Very interesting, I though installer (snapd daemon) does not actually allow to do more than one action at a time, but we can test this to make sure. Actually even if it does that it should be alright but maybe a bit slowed and probably require more memory. I guess we can disable installer parallel actions the same way we do for backups right now, we just need to move python backend code to go backend.

Testing

If you want to test I would use our Virtual Box image where you can do anything you want.

Logging

While we try to move everything to syslog there are more log files here still: /var/snap/platform/common/log/platform.log

cyberb commented 1 year ago

We have now more logic moved to backend and now we are ready to introduce Status page where you could see what is running and not allow parallel jobs which potentially affect each other like app installs, backups, ...

cyberb commented 7 months ago

New UI install progress is in place and fixes app install/upgrade/remove page reload or opening in a new tab will always show currect progress for an app.