Code Monkey home page Code Monkey logo

Comments (3)

ptaoussanis avatar ptaoussanis commented on June 10, 2024

Hi Kyle- I'm not aware off-hand of any reason why a request would both complete successfully and throw.

From a quick skim of the code, there's a retry mechanism here that seems to be intended to work around connections incorrectly marked as keep-alive.

It's not immediately obvious to me how that'd cause a problem, but it's possible there's a bug somewhere - would need to look more closely.

Can you share any more info re: your http-kit version, OS, and what you've observed that makes you suspicious?

from http-kit.

aphyr avatar aphyr commented on June 10, 2024

This is with httpkit 2.7.0, OpenJDK 21.0.1 2023-10-17, Linux Mint 21.2 "Victoria". I'm seeing odd behavior in a Jepsen test: sometimes an HTTP request throws "connection refused", but the request's effects (which are unique) are nonetheless visible in future reads of the system. Sometimes this sort of thing happens when a client, say, issues a request, the request arrives at the server and is processed, but the connection fails before receiving an ack, the client issues a retry, the retry hits conn-refused, and the client throws that error instead of the original timeout/reset. I'm really not sure about this though--it seems odd that we'd ever retry a POST request at all, I don't have a reliable repro case, and the test suite that I'm seeing this behavior with is kind of a pain in the ass to run.

It's entirely possible this is some kind of mistake on my end--I just haven't caught it yet. Figured I'd ask in case there was an obvious answer at hand. ;-)

from http-kit.

ptaoussanis avatar ptaoussanis commented on June 10, 2024

Thanks for the extra context 👍

Figured I'd ask in case there was an obvious answer at hand. ;-)

Nothing immediately obvious that I know of, but I'm also not too familiar with http-kit's client code so would need to look closer to be sure.

Are you able to reliably reproduce the odd behaviour?

If so, one idea might be to try replace http-kit client with an alternative if feasible (e.g. clj-http) to see if the problem persists or not. If that'd be too cumbersome, might be worth at least trying http-kit v2.8.0-beta3 just to rule out the possibility of some bug that's already been fixed.

Otherwise will try take a closer look at this the next time I'm doing batched work on http-kit.

Good luck!

from http-kit.

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.