ipfs-search / ipfs-tika

Java web application taking IPFS hashes, extracting (textual) content and metadata through Apache's Tika.
GNU Affero General Public License v3.0
32 stars 5 forks source link

Handle IPFS timeouts better #8

Open dokterbob opened 5 years ago

dokterbob commented 5 years ago

even SOCKET_READ_TIMEOUT is set, the nanohttpd doesn't interrupt, rather, it will continue. after some time the response is returned and sent back to python which is already closed the connection. this results in

fi.iki.elonen.NanoHTTPD$Response send SEVERE: Could not send response to the client ... for example QmT4f6M5mHkMvEGhKW824hkLkJ25XTwQ3ZasWQbuKHocXB requested on page 1, but by the time the response returned python was requesting page 9.

So, all timeouted requests you see below has returned in ipfs-tika java file either with the proper result or FileNotFoundException result.

Internal server error: java.io.FileNotFoundException: http://localhost:8080/ipfs/Qma9uWJNVfQ18TGTLNdaVNtmMomVJwSEatGZQvrEPDDu77 Dec 19, 2018 6:45:56 PM fi.iki.elonen.NanoHTTPD$Response send SEVERE: Could not send response to the client java.net.SocketException: Broken pipe (Write failed) at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111) at java.net.SocketOutputStream.write(SocketOutputStream.java:143) at fi.iki.elonen.NanoHTTPD$Response$ChunkedOutputStream.write(NanoHTTPD.java:1259) at fi.iki.elonen.NanoHTTPD$Response$ChunkedOutputStream.write(NanoHTTPD.java:1252) at java.util.zip.GZIPOutputStream.writeHeader(GZIPOutputStream.java:182) at java.util.zip.GZIPOutputStream.(GZIPOutputStream.java:94) at java.util.zip.GZIPOutputStream.(GZIPOutputStream.java:109) at fi.iki.elonen.NanoHTTPD$Response.sendBodyWithCorrectEncoding(NanoHTTPD.java:1449) at fi.iki.elonen.NanoHTTPD$Response.sendBodyWithCorrectTransferAndEncoding(NanoHTTPD.java:1440) at fi.iki.elonen.NanoHTTPD$Response.send(NanoHTTPD.java:1429) at fi.iki.elonen.NanoHTTPD$HTTPSession.execute(NanoHTTPD.java:852) at fi.iki.elonen.NanoHTTPD$ClientHandler.run(NanoHTTPD.java:189) at java.lang.Thread.run(Thread.java:748)

Origin: #6