#164 Cross-Origin requests make the server hang

development version
closed-out-of-date
nobody
None
5
2014-03-25
2013-03-01
No

After switching our web form (http://www.languagetool.org) to send requests directly to our embedded HTTP server (com.sun.net.httpserver.HttpServer) instead to the proxy, the server became instable. After a few hours, it simply stopped responding to requests.

The server-side patch was this:
https://github.com/danielnaber/languagetool-mirror/commit/882090c2f429c74e21d2815998b9ecf74d96a04b

The client-side patch was simply switching from proxy to direct server requests:
http://languagetool.svn.sourceforge.net/viewvc/languagetool/trunk/website/include/header.php?r1=9336&r2=9473

This is the stacktrace when the server hangs:

"Thread-2" prio=10 tid=0x0000000017fc4800 nid=0x1c2b runnable
[0x00002ba5ec97c000]
java.lang.Thread.State: RUNNABLE
at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:218)
at sun.nio.ch.IOUtil.read(IOUtil.java:191)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:359)
- locked <0x00000000fd1e4b98> (a java.lang.Object)
at sun.net.httpserver.SSLStreams$EngineWrapper.recvAndUnwrap(SSLStreams.java:334)
- locked <0x00000000fd1e4c58> (a java.lang.Object)
at sun.net.httpserver.SSLStreams.recvData(SSLStreams.java:409)
at sun.net.httpserver.SSLStreams$InputStream.read(SSLStreams.java:524)
at sun.net.httpserver.SSLStreams$InputStream.read(SSLStreams.java:593)
at sun.net.httpserver.Request.readLine(Request.java:84)
at sun.net.httpserver.Request.<init>(Request.java:54)
at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:529)
at sun.net.httpserver.ServerImpl$DefaultExecutor.execute(ServerImpl.java:156)
at sun.net.httpserver.ServerImpl$Dispatcher.handle(ServerImpl.java:424)
at sun.net.httpserver.ServerImpl$Dispatcher.run(ServerImpl.java:389)
at java.lang.Thread.run(Thread.java:722)

Adding "Connection: close" to the server's HTTP response didn't seem to help.

Discussion

  • Daniel Naber

    Daniel Naber - 2014-03-25
    • status: open --> closed-out-of-date
    • Group: --> development version
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks