-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fulltext search: Show display of index creation progress #7961
Comments
Right now the progress is shown as indeterminate, as it is quite hard to estimate (the last file in the queue could be the size of all others combined). Something like |
I like that, because user can expect that file sizes vary. Similar to the progress of a backup tool. If users would like to have more, the progress could add the file sizes. Like an asynchronous update of the total number of files and total file size like rclone does. |
The currentfile / all files counter sounds like a sensible thing. |
Then let's do the currentfile / all files counter for now. |
Sorry for the delay. I implemented the
This was intended behaviour actually. I wanted it to actually be completely in the background and only have the progress shown on demand. Now you might ask why and I am afraid I don't have a satisfactory answer. I now agree that having the indicator reflect the progress of the indexing as well would be helpful. Some changes are needed for that though because currently, all index-operations are hidden in a single task. That task is just a placeholder so the indexer shows up in the list of background tasks, but the actual operations are done in tasks that are not displayed at all and just bind the progress and message to the placeholder tasks. This was done because:
This means:
We could solve this by:
|
I agree that you don't want to have the index operation for each file showing up in the progress pane. It's just too much noise. Thus, I would say showing one "Indexing" task per database is perfectly fine. |
I guess the usual use-case is not to add lots of individual files in a single use of JabRef, is that correct? Just to clarify, when starting JabRef, there would still be just one task per database updating the index (in case pdf's changed since JabRef was last started). Then, additional tasks would be added for each new/removed pdf. So it's not terribly overwhelming, but I still think having one task per database would be better. If so, we could add a second indicator in the message, something like:
I'm struggling to explain myself here since there are two kinds progress indicators, so let's give them names for now:
#7981 only updates the individual progress indicator. The average progress indicator currently averages the individual progress of running progress tasks. The thing is, we cannot write the 'running' property. It is set by Task and since it is only a placeholder task it is never actually run and therefore false. We would need another way of filtering out finished tasks. This would be the second option in my list of ideas:
but I now realized that this would be even more difficult than expected, since for the progress-indicator we only have a list of |
@tobiasdiez do you have any more thoughts on this? I am struggling to decide how to move forward. |
Why is it only a placeholder task? I'm not that familiar with how you implemented the index background tasks (and don't really have the time to dive into this), but maybe something like the following gives some ideas:
You need to be a bit careful with what kind of queue you are using, since it's accessed from different threads but something like ConcurrentLinkedQueue should handle that. |
Overall I think your approach would probably be more comprehensible and easier to maintain (no need for the placeholder task), but:
The problem that I am currently trying to solve is that the 'average progress indicator' in the menu shows no task running while indexing because of the use of the placeholder task that is never running. With your suggestion, the issue would be the other way around, with the indexing task always running. It's less of a problem, since when the task is idle it's progress would be 100%, but it would still affect the average progress. ... and the more I write about this the less this sounds like an actual problem so let me try to implement your approach :) Thanks again! |
The background task can also simply stop once the queue is empty, and be restarted if another PDF is added to the queue. I think this is more effective than having the background task check the queue every few milliseconds. |
Oh, I thought tasks can only run once.
Definitely. I expected there to be a locking flag in CuncurrentLinkedQueue to avoid the busy wait, but stoping and restarting sounds like a great way to solve this! Thanks! |
Is your suggestion for improvement related to a problem? Please describe.
Currently, no progress or indication of the background index creation is shown. This may irritate some users because they may think that there is a performance bug in jabref due to the high usage of resources.
Describe the solution you'd like
Show an indicator of the progress (how many files to go etc) in the progress icon in the upper right corner of the screen.
@btut @koppor @calixtus
The text was updated successfully, but these errors were encountered: