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

Better status message when adding existing repo #1306

Open
m3nu opened this issue May 20, 2022 · 13 comments · May be fixed by #1643
Open

Better status message when adding existing repo #1306

m3nu opened this issue May 20, 2022 · 13 comments · May be fixed by #1643
Assignees
Labels
good first issue Simple change to start learning code base help wanted This issue is available, comment if you want to fix it type:enhancement Improvement of an existing function

Comments

@m3nu
Copy link
Contributor

m3nu commented May 20, 2022

Describe the bug
With Borg 1.2, Borg will pull a good amount of data before adding the repo. Currently we don't show a proper status message and just block the UI.

Proposed solution is to avoid blocking the UI and show a meaningful status message.

To Reproduce
Steps to reproduce the behavior:

  1. Add existing repo of +10GB or so size
  2. UI blocks for several seconds to a minute

Environment (please complete the following information):

  • OS: macOS
  • Vorta version: 0.8.4
  • Installed from: macOS binary
@m3nu m3nu added the type:enhancement Improvement of an existing function label May 20, 2022
@m3nu m3nu added this to the v0.8.x (Next minor release) milestone May 20, 2022
@real-yfprojects real-yfprojects added good first issue Simple change to start learning code base help wanted This issue is available, comment if you want to fix it labels Feb 8, 2023
@DaffyTheDuck
Copy link

Hi! The repo should be over the net right? because if I add a local, it fetches it instantly 🤔

@DaffyTheDuck
Copy link

Can I try to work on this after #1620 is merged ?

@real-yfprojects
Copy link
Collaborator

👍 Have a look how this was implemented for other long running jobs.

@real-yfprojects
Copy link
Collaborator

Hi! The repo should be over the net right? because if I add a local, it fetches it instantly thinking

A slow internet connection or disk speed will extend the time needed.

@DaffyTheDuck
Copy link

Hi! Actually I've a issue testing/reproducing it 😅

  1. I've a local repo with size ~15GB
  2. When I add it to vorta the UI is not freezing

any recommendation on how can I reproduce this issue ? 😅

@real-yfprojects
Copy link
Collaborator

Try a slow usb stick or a remote repo with a slow internet connection. You can also try throttling disc speed for vorta.

@DaffyTheDuck
Copy link

Hi! @real-yfprojects, I can reproduce the issue now, as per @m3nu 's suggestion we could show a status message, the status message will be in a form of popup ? because the status is already shown as Validating Existing Repo 🤔

@real-yfprojects
Copy link
Collaborator

I can reproduce the issue now, as per @m3nu 's suggestion we could show a status message, the status message will be in a form of popup ?

I think that would qualify as blocking the ui since we currently show a popup too.

@DaffyTheDuck
Copy link

I can reproduce the issue now, as per @m3nu 's suggestion we could show a status message, the status message will be in a form of popup ?

I think that would qualify as blocking the ui since we currently show a popup too.

Hm! So I assume that, this might be a threading problem 🤔 since it is a long task other inputs are getting registered but are not reflecting instantly resulting in Program Not Responding problem

I've also seen that the python's threading is used in jobs_manager.py I'm just wondering about QThread of PyQT @real-yfprojects

@real-yfprojects
Copy link
Collaborator

Python's threading library is very well integrated and imo the better choice. Still we sometimes use QThread since it exposes a finished signals. AFAIK pyqt signals only work correctly when being called/instanciated from/in a QThread. There would be multiple possibilities for implemtikg this. You could do it similar to here:

https://github.com/borgbase/vorta/blob/master/src/vorta/views/diff_result.py#L28-L29

Or close the the add repo dialog and let init run as a normal borgjob like other commands do too.

@DaffyTheDuck
Copy link

DaffyTheDuck commented Mar 11, 2023

Python's threading library is very well integrated and imo the better choice. Still we sometimes use QThread since it exposes a finished signals. AFAIK pyqt signals only work correctly when being called/instanciated from/in a QThread. There would be multiple possibilities for implemtikg this. You could do it similar to here:

https://github.com/borgbase/vorta/blob/master/src/vorta/views/diff_result.py#L28-L29

Or close the the add repo dialog and let init run as a normal borgjob like other commands do too.

Hi! I've tried closing the dialog box and it still does not responds some times, I think the UI breaks because of the mouse clicks as it keeps listening to user inputs while it is completing a long job, but if we leave the process idle it would complete without any problem (I didn't try with the 10+ GB repos mentioned above since I'm using the trial version of borgbase). In my opinion disabling mouse clicks would work . I know this might look rude like you are disabling the mouse just to overcome the issue, but that might help

Btw is there any way we could see the fetching percentage ? we could add a progress bar to show update the user about the progress instead of showing Validating Repo 🤔

What do you think @real-yfprojects 😅

@real-yfprojects
Copy link
Collaborator

Btw is there any way we could see the fetching percentage ?

Try running borg info with --progress. I don't know whether that will give you any progress information.

I think the UI breaks because of the mouse clicks as it keeps listening to user inputs while it is completing a long job

The issue should be that the borg job isn't run in a new thread, blocking the current thread. Therefore qt isn't able to process any GUI events.

thread = BorgInfoRepoJob(params['cmd'], params)
thread.updated.connect(self._set_status)
thread.result.connect(self.run_result)
self.thread = thread # Needs to be connected to self for tests to work.
self.thread.run()

The variable is named incorrectly since a borg job doesn't create a thread.

@DaffyTheDuck
Copy link

Works Now! but has a small bug, let me push the changes 😄

DaffyTheDuck added a commit to DaffyTheDuck/vorta that referenced this issue Mar 12, 2023
- Avoids Blocking UI When Adding Existing Repo

Closes borgbase#1306
DaffyTheDuck added a commit to DaffyTheDuck/vorta that referenced this issue Mar 12, 2023
- Avoids freezing UI when an existing repo is added

Closes borgbase#1306
DaffyTheDuck added a commit to DaffyTheDuck/vorta that referenced this issue Mar 12, 2023
- Avoids freezing UI when an existing repo is added

Closes borgbase#1306
@DaffyTheDuck DaffyTheDuck linked a pull request Mar 12, 2023 that will close this issue
9 tasks
DaffyTheDuck added a commit to DaffyTheDuck/vorta that referenced this issue Mar 14, 2023
- Avoids freezing UI when an existing repo is added.

Closes borgbase#1306
DaffyTheDuck added a commit to DaffyTheDuck/vorta that referenced this issue Mar 14, 2023
- Avoids freezing UI when an existing repo is added.

Closes borgbase#1306
DaffyTheDuck added a commit to DaffyTheDuck/vorta that referenced this issue Mar 15, 2023
- Avoids freezing UI when an existing repo is added

Closes borgbase#1306
DaffyTheDuck added a commit to DaffyTheDuck/vorta that referenced this issue Mar 15, 2023
- Avoids freezing UI when an existing repo is added

Closes borgbase#1306
DaffyTheDuck added a commit to DaffyTheDuck/vorta that referenced this issue Apr 7, 2023
- Avoids freezing UI when an existing repo is added.

Closes borgbase#1306
DaffyTheDuck added a commit to DaffyTheDuck/vorta that referenced this issue Apr 7, 2023
- Avoids freezing UI when an existing repo is added.

Closes borgbase#1306
DaffyTheDuck added a commit to DaffyTheDuck/vorta that referenced this issue Apr 21, 2023
- Avoids freezing UI when an existing repo is added

Closes borgbase#1306
DaffyTheDuck added a commit to DaffyTheDuck/vorta that referenced this issue Apr 21, 2023
- Avoids freezing UI when an existing repo is added

Closes borgbase#1306
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Simple change to start learning code base help wanted This issue is available, comment if you want to fix it type:enhancement Improvement of an existing function
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants