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

JabRef freezes when importing unlinked PDF files into Database #2309

Closed
onewiki opened this issue Nov 22, 2016 · 10 comments
Closed

JabRef freezes when importing unlinked PDF files into Database #2309

onewiki opened this issue Nov 22, 2016 · 10 comments
Labels
bug Confirmed bugs or reports that are very likely to be bugs
Milestone

Comments

@onewiki
Copy link

onewiki commented Nov 22, 2016

JabRef version on 3.7

Steps to reproduce:

  1. .Quality - Find unlinked files
  2. Apply to the selected files (PDF)
  3. Shows "Importing into Database" and the program freezes
Put the excerpt of the log file here
@onewiki onewiki changed the title JabRef freezes when JabRef freezes when importing unlinked PDF files into Database Nov 22, 2016
@koppor
Copy link
Member

koppor commented Nov 23, 2016

We had a similar issue #410

@stefan-kolb stefan-kolb added the bug Confirmed bugs or reports that are very likely to be bugs label Dec 7, 2016
@stefan-kolb
Copy link
Member

Thank you for your report 😄
I can reproduce the behavior and we will work on a fix for this issue. Stay tuned.

@stefan-kolb
Copy link
Member

@lenhard Maybe a problem caused by the chnages in the thread executor? Code where this functionality here happens is in FindUnlinkedFilesDialog.java starting from line 523

@stefan-kolb
Copy link
Member

If I debug this and set a breakpoint in line 550 the dialog is enabled again afterwards, so this should be some timing problem with the threads.

@stefan-kolb
Copy link
Member

If I remove the invokeLater commands it works for me, so there exists some scheduling problem here?

        JabRefExecutorService.INSTANCE.execute(() -> {
            List<String> errors = new LinkedList<>();
            creatorManager.addEntriesFromFiles(fileList, databaseContext.getDatabase(), frame.getCurrentBasePanel(),
                    entryType, checkBoxWhyIsThereNoGetSelectedStupidSwing, new ChangeListener() {

                        int counter;

                        @Override
                        public void stateChanged(ChangeEvent e) {
                            counter++;
                            progressBarImporting.setValue(counter);
                            progressBarImporting.setString(Localization.lang("%0 of %1", Integer.toString(counter),
                                        Integer.toString(progressBarImporting.getMaximum())));
                        }
                    }, errors);
            importFinishedHandler(errors);
        });

@lenhard
Copy link
Member

lenhard commented Dec 7, 2016

@stefan-kolb The threading changes were merged last Friday, whereas this issue was reported 15 days ago, so the changes in the threading PR cannot be the cause.

I can confirm that this is a threading issue. Sometimes the import works fine, sometimes it blocks. I does not make a difference if you execute it on the EDT (what the SwingUtilities.invokeLater() did) or not. It is likely a bug inside FindUnlinkedFilesDialog, since this class implements thread scheduling itself (seach for threadState). My guess is that the class always had this issue.

Since this class is a good example of terrible engineering, a rewrite would probably be the least painful fix.

@stefan-kolb stefan-kolb added this to the v3.8 milestone Dec 9, 2016
@stefan-kolb
Copy link
Member

@JabRef/developers This one is a blocker for v3.8

@lenhard
Copy link
Member

lenhard commented Dec 16, 2016

@stefan-kolb As discussed in private chat: no it is not.

Unfortunately, we cannot find your commit on master (or any other branch), otherwise we would have merged it. Therefore, we are moving this to 4.0

@andrewufrank
Copy link

andrewufrank commented Jan 18, 2017

i would appreciate to be informed if there is a new fix in a new build for this problem. i am happy to run it with the debug option. i have currently JabRef-3.8.2-dev--snapshot--2017-01-16--master--9e48a5ff8.jar
. anything better to test? any workaround possible? would a different jre or jdk help (see error message?)
thank you for this feature - it will be very useful when it works reliably.

the current error message i get is:

frank@santafe:~/Downloads$ java -jar JabRef-3.8.2-dev--snapshot--2017-01-16--master--9e48a5ff8.jar
09:44:42.628 [AWT-EventQueue-1] WARN net.sf.jabref.JabRefGUI - There seem to be problems with OpenJDK and the default GTK Look&Feel. Using Metal L&F instead. Change to another L&F with caution.
09:44:42.642 [AWT-EventQueue-1] INFO net.sf.jabref.logic.importer.OpenDatabase - Opening: /home/frank/Templates/5273_geoinfo_biblio/geoinfo_bib/paperCollection.bib
09:46:52.727 [SwingWorker-pool-3-thread-1] WARN net.sf.jabref.gui.worker.VersionWorker - Could not connect to the updateserver.
java.net.ConnectException: Connection timed out (Connection timed out)
at java.net.PlainSocketImpl.socketConnect(Native Method) ~[?:1.8.0_111]
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[?:1.8.0_111]
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[?:1.8.0_111]
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[?:1.8.0_111]
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[?:1.8.0_111]
at java.net.Socket.connect(Socket.java:589) ~[?:1.8.0_111]
at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:668) ~[?:1.8.0_111]
at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173) ~[?:1.8.0_111]
at sun.net.NetworkClient.doConnect(NetworkClient.java:180) ~[?:1.8.0_111]
at sun.net.www.http.HttpClient.openServer(HttpClient.java:432) ~[?:1.8.0_111]
at sun.net.www.http.HttpClient.openServer(HttpClient.java:527) ~[?:1.8.0_111]
at sun.net.www.protocol.https.HttpsClient.(HttpsClient.java:264) ~[?:1.8.0_111]
at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367) ~[?:1.8.0_111]
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191) ~[?:1.8.0_111]
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1138) ~[?:1.8.0_111]
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1032) ~[?:1.8.0_111]
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177) ~[?:1.8.0_111]
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1546) ~[?:1.8.0_111]
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474) ~[?:1.8.0_111]
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254) ~[?:1.8.0_111]
at net.sf.jabref.logic.util.Version.getAllAvailableVersions(Version.java:93) ~[JabRef-3.8.2-dev--snapshot--2017-01-16--master--9e48a5ff8.jar:?]
at net.sf.jabref.gui.worker.VersionWorker.doInBackground(VersionWorker.java:55) [JabRef-3.8.2-dev--snapshot--2017-01-16--master--9e48a5ff8.jar:?]
at net.sf.jabref.gui.worker.VersionWorker.doInBackground(VersionWorker.java:29) [JabRef-3.8.2-dev--snapshot--2017-01-16--master--9e48a5ff8.jar:?]
at javax.swing.SwingWorker$1.call(SwingWorker.java:295) [?:1.8.0_111]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_111]
at javax.swing.SwingWorker.run(SwingWorker.java:334) [?:1.8.0_111]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_111]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_111]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]

@koppor koppor closed this as completed in d2b555d Jan 20, 2017
@koppor
Copy link
Member

koppor commented Jan 20, 2017

@andrewufrank Please try again the latest build from https://builds.jabref.org/master/

Siedlerchr added a commit that referenced this issue Jan 26, 2017
* upstream/master:
  Fix medline tests...again (#2492)
  Make sure that unregistered event sources do not stop JabRef from shu… (#2487)
  Fix #2481: ClassCastException because of wrong cast (#2490)
  Catch NumberFormatException if context can't be parsed in groups (#2488)
  Improve CHANGELOG formatting
  Update guava from 20.0 to 21.0 and mockito-core from 2.5.5 to 2.6.2
  Fix aux duplicates (#2480)
  add update from DOI to the entryeditor sidebar (#2476)
  Remove obsolete import
  Add CHANGELOG entry (and one more link)
  Resolves #2309 JabRef freezes when importing unlinked PDF files into Database
  Update CHANGELOG.md
  Fixed bug when assigning refs to groups.
  emove html code from ACM fetcher before calling parser to prevent junk in bib file (#2473)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs
Projects
None yet
Development

No branches or pull requests

5 participants