danielnaber / oxygen-languagetool-plugin

LanguageTool plugin for the Oxygen XML editor
GNU Lesser General Public License v2.1
8 stars 4 forks source link

Timeout with large files #9

Closed MikeUnwalla closed 7 years ago

MikeUnwalla commented 7 years ago

A test file contains approximately 4000 lines, each line of which is 'This is a example input to to show you how LanguageTool works.'

LT gives a 'timed out' message: oxygen-time-out

The number of lines at which the error occurred was not constant. But with approximately 3000 lines I did not get the 'timed out' message.

danielnaber commented 7 years ago

How long was the time between starting the check and getting the timeout message?

MikeUnwalla commented 7 years ago

Approximately 42 seconds.

-----Original Message----- From: Daniel Naber [mailto:notifications@github.com] Sent: 02 December 2016 14:14 To: danielnaber/oxygen-languagetool-plugin Cc: Mike Unwalla; Author Subject: Re: [danielnaber/oxygen-languagetool-plugin] Timeout with large files (#9)

How long was the time between starting the check and getting the timeout message?

danielnaber commented 7 years ago

I can reproduce this. Full stack trace:

391401 INFO [ Thread-10 ] org.apache.http.impl.execchain.RetryExec - Retrying request to {}->http://localhost:8081
java.lang.RuntimeException: Could not check text using LanguageTool server at URL 'http://localhost:8081':

ro.sync.net.protocol.http.abstraction.f: Read timed out (http://localhost:8081/v2/check)

Please make sure the LanguageTool server is running at this URL or
change the location at Options -> Preferences... -> Plugins.
    at org.languagetool.oxygen.LanguageToolClient.checkText(LanguageToolClient.java:73)
    at org.languagetool.oxygen.LanguageToolPluginExtension.checkText(LanguageToolPluginExtension.java:213)
    at org.languagetool.oxygen.LanguageToolPluginExtension.access$400(LanguageToolPluginExtension.java:58)
    at org.languagetool.oxygen.LanguageToolPluginExtension$5.run(LanguageToolPluginExtension.java:163)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: ro.sync.net.protocol.http.abstraction.f: Read timed out (http://localhost:8081/v2/check)
    at org.languagetool.remote.RemoteLanguageTool.getConnection(RemoteLanguageTool.java:154)
    at org.languagetool.remote.RemoteLanguageTool.check(RemoteLanguageTool.java:119)
    at org.languagetool.remote.RemoteLanguageTool.check(RemoteLanguageTool.java:62)
    at org.languagetool.oxygen.LanguageToolClient.checkText(LanguageToolClient.java:56)
    ... 4 more
Caused by: ro.sync.net.protocol.http.abstraction.f: Read timed out (http://localhost:8081/v2/check)
    at ro.sync.net.protocol.http.b.d.j(Unknown Source)
    at ro.sync.net.protocol.http.abstraction.o.s(Unknown Source)
    at ro.sync.net.protocol.http.abstraction.o.f(Unknown Source)
    at ro.sync.net.protocol.http.WebdavHttpURLConnection$_c.close(Unknown Source)
    at java.io.FilterOutputStream.close(FilterOutputStream.java:159)
    at org.languagetool.remote.RemoteLanguageTool.getConnection(RemoteLanguageTool.java:151)
    ... 7 more
danielnaber commented 7 years ago

Okay, I now know to fix this: by adding e.g. conn.setReadTimeout(5*60*1000); to RemoteLanguageTool.getConnection(). Is this an urgent issue for you? I'm not so sure it makes sense to increase the timeout to several minutes, as long as there's no visual feedback for the user about the progress of the check.

MikeUnwalla commented 7 years ago

It's not an urgent problem. (I have not received complaints from customers!)

I agree that increasing the timeout when there is no indication of progress is not sensible. A note about the timeout in the 'Known Limitations' section of the download page would be useful.

danielnaber commented 7 years ago

I've added this to the "Known limitations".