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

Cancel index background worker when exiting JabRef #8468

Closed
ColinScarato opened this issue Jan 27, 2022 · 11 comments · Fixed by #8478 or #8651
Closed

Cancel index background worker when exiting JabRef #8468

ColinScarato opened this issue Jan 27, 2022 · 11 comments · Fixed by #8478 or #8651
Assignees
Labels
component: external-files [outdated] type: bug Confirmed bugs or reports that are very likely to be bugs
Milestone

Comments

@ColinScarato
Copy link

Jabref 5.5 automatically looks for files to autolink with all entries when opening a database. I use a relatively big database whose linked files are stored on a network drive; every time I open it Jabref tries to freshly scan to autolink files, as it probably believes that the files in the network drive might have changed.
This results in 10 minutes of background tasks running, meaning that every time I open and close Jabref in less than a 10 minutes I get an additional prompt to wait for background tasks to finish running.

Would it be possible to add a setting to disable file autolinking?
Thanks!

@tobiasdiez tobiasdiez added component: external-files [outdated] type: bug Confirmed bugs or reports that are very likely to be bugs labels Jan 27, 2022
@tobiasdiez
Copy link
Member

Do you really mean the autolink or fulltext indexing? I noticed this problem with the latter but not the former.

I think it would already help with the background task would just be canceled when exiting. There is no need to finish the indexing if you close the app anyway ;-)

cc @btut

@ColinScarato
Copy link
Author

autolink
That looks like indexing :)

@Siedlerchr Siedlerchr changed the title Disable automatic file autolink Option to disable indexing Jan 27, 2022
btut added a commit that referenced this issue Jan 31, 2022
Siedlerchr added a commit that referenced this issue Jan 31, 2022
* Introduce preference to disable fulltext indexing

Fixes #8468

* Improve l10n

* fix l10n

Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>
Co-authored-by: Siedlerchr <siedlerkiller@gmail.com>
@tobiasdiez
Copy link
Member

While the option to completely disable index is certainly very nice to have (thanks @btut!), the issue that the index background worker is not cancel automatically when JabRef is closed still remains.

@tobiasdiez tobiasdiez reopened this Feb 13, 2022
@tobiasdiez tobiasdiez changed the title Option to disable indexing Cancel index background worker when exiting JabRef Feb 13, 2022
@btut
Copy link
Contributor

btut commented Feb 14, 2022

So you want to have an option to disable the graceful-close dialog that asks to quit while tasks are running? Why would you want that?
If you don't want to use indexing, disable it. If not, I find the warning quite useful.
The only option I can imagine without cluttering the preferences would be to have a 'don't show this dialog again' checkbox, but the dialog does not only show indexing tasks. The dialog should also pop-up when a file-download is still ongoing. Would you want to just cancel that as well and have a half-downloaded file?

I wonder why for @ColinScarato JabRef tries to re-index every time. It should only do that for files that are not yet in the index or they changed since they were indexed. Does the timestamp-query fail and JabRef thinks all files were update because of the network drive? If this would work you would just have to let JabRef index once and be done with it. Individual added/changed files should be indexed fast enough for you not to notice.

@ColinScarato
Copy link
Author

I'm not sure why it fails to recognise indexed files, it doesn't show me more info. I just saw that it does it correctly locally, but not on that shared drive.
Disabling indexing is fine to me personally. Given that we don't have a completely streamlined pdf organisation yet, and that auto-indexing seems to fail for network shares anyway, we link the pdfs manually.

@btut
Copy link
Contributor

btut commented Feb 14, 2022

The thing is if we knew why it fails to understand that these files are not new, we could try to detect such scenarios and disable the updates to the index.

One thing just to be sure: I assume you already tried this, but did you ever let JabRef index all of your files without closing? So waiting for the background task to actually finish? What should happen then is the indexer-task still runs, but should be done within a second or so since it realizes that all files are up-to-date.

@ColinScarato
Copy link
Author

Yes I tried to let it run (on several PCs). I'm not sure if I can see logs of what happened.

@btut
Copy link
Contributor

btut commented Feb 14, 2022

Thanks. I don't think there would be logs as I don't have any idea why this could be failing. Could you share:

  • what operating system you use
  • what kind of network share you are using
  • how you mount the network share

Then I could investigate what the issue may be.

@tobiasdiez
Copy link
Member

tobiasdiez commented Feb 14, 2022

For me it seems to just iterate the files, without actually re-indexing them. But even this takes about a minute for 2k entries. I could imagine that on a shared network service it is even slower.

So you want to have an option to disable the graceful-close dialog that asks to quit while tasks are running? Why would you want that?

No, I just want that it exists immediately without any user interaction, and then picks up the reindexing once I start JabRef again. I don't think indexing is such an important task that needs to be finished before I'm allowed to close JabRef.

@ColinScarato
Copy link
Author

Thanks. I don't think there would be logs as I don't have any idea why this could be failing. Could you share:

* what operating system you use

* what kind of network share you are using

* how you mount the network share

Then I could investigate what the issue may be.

  • Windows 10
  • xfs file system, available via smb in the case of Windows
  • I mount it with the file explorer in Windows (equivalent to net use...)

@koppor
Copy link
Member

koppor commented Mar 28, 2022

DevCall decision: Just cancel the indexing and do NOT a graceful shutdown.

@btut btut self-assigned this Mar 28, 2022
@koppor koppor added this to the v5.6 milestone Mar 28, 2022
@koppor koppor moved this to Done in Prioritization Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: external-files [outdated] type: bug Confirmed bugs or reports that are very likely to be bugs
Projects
Archived in project
4 participants