Coder Social home page Coder Social logo

Comments (6)

anjackson avatar anjackson commented on July 18, 2024

Perhaps safeClose(Socket) needs tweaking to cope with java.net.SocketException: Broken pipe ? Hmm, guess not as SocketException is a subclass of IOException.

There's a lot of this too:

java.net.SocketException: Socket closed
        at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:116)
        at java.net.SocketOutputStream.write(SocketOutputStream.java:141)
        at tinycdxserver.NanoHTTPD$Response.send(NanoHTTPD.java:535)
        at tinycdxserver.NanoHTTPD$HTTPSession.execute(NanoHTTPD.java:840)
        at tinycdxserver.NanoHTTPD$1$1.run(NanoHTTPD.java:205)
        at java.lang.Thread.run(Thread.java:745)

from outbackcdx.

ato avatar ato commented on July 18, 2024

When it's looping is it repeating those same two exceptions over and over?

from outbackcdx.

ato avatar ato commented on July 18, 2024

I can reproduce the IllegalArgumentException like this against the latest version but it doesn't loop:

$ curl 'http://localhost:8080/myindex?q=%'
curl: (52) Empty reply from server

from outbackcdx.

anjackson avatar anjackson commented on July 18, 2024

It's hard to tell, and we've deleted the log file now, and it's not erroring at the moment. Here's the largest chunk of errors I could find in my console history:

java.lang.IllegalArgumentException: URLDecoder: Incomplete trailing escape (%) p                                  attern
        at java.net.URLDecoder.decode(URLDecoder.java:187)
        at tinycdxserver.XmlQuery.decodeQueryString(XmlQuery.java:49)
        at tinycdxserver.XmlQuery.<init>(XmlQuery.java:32)
        at tinycdxserver.XmlQuery.query(XmlQuery.java:192)
        at tinycdxserver.Server.query(Server.java:182)
        at tinycdxserver.Server.serve(Server.java:126)
        at tinycdxserver.NanoHTTPD$HTTPSession.execute(NanoHTTPD.java:831)
        at tinycdxserver.NanoHTTPD$1$1.run(NanoHTTPD.java:205)
        at java.lang.Thread.run(Thread.java:745)
java.net.SocketException: Broken pipe
        at java.net.SocketOutputStream.socketWrite0(Native Method)
        at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
        at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
        at tinycdxserver.NanoHTTPD$Response.sendAsFixedLength(NanoHTTPD.java:598                                  )
        at tinycdxserver.NanoHTTPD$Response.send(NanoHTTPD.java:546)
        at tinycdxserver.NanoHTTPD$HTTPSession.execute(NanoHTTPD.java:840)
        at tinycdxserver.NanoHTTPD$1$1.run(NanoHTTPD.java:205)
        at java.lang.Thread.run(Thread.java:745)
java.net.SocketException: Broken pipe
        at java.net.SocketOutputStream.socketWrite0(Native Method)
        at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
        at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
        at tinycdxserver.NanoHTTPD$Response.sendAsFixedLength(NanoHTTPD.java:598                                  )
        at tinycdxserver.NanoHTTPD$Response.send(NanoHTTPD.java:546)
        at tinycdxserver.NanoHTTPD$HTTPSession.execute(NanoHTTPD.java:840)
        at tinycdxserver.NanoHTTPD$1$1.run(NanoHTTPD.java:205)
        at java.lang.Thread.run(Thread.java:745)
[snip]

(Edit by @ato: I moved the rest here for my issue reading sanity: https://gist.github.com/ato/d1b57f7401603fce736a153539770be1 )
(Edit by @anjackson: Ah good idea should have thought of that....)

from outbackcdx.

ato avatar ato commented on July 18, 2024

I think the looping is caused by a request larger than the httpd request buffer: NanoHttpd/nanohttpd#362
I've put in a workaround to reject too large requests. If you actually need to query for URLs large than 8000 characters we might need a different solution though.

from outbackcdx.

anjackson avatar anjackson commented on July 18, 2024

No, URLs over 8000 chars can be ignored. Maybe our systems are mis-handling some discovered data: URIs.

from outbackcdx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.