Giter VIP home page Giter VIP logo

Comments (3)

bbatsov avatar bbatsov commented on May 30, 2024

@shen-tian You can take at this ticket as point if you want. It's somewhat related to what you've been working on recently.

from nrepl.

shen-tian avatar shen-tian commented on May 30, 2024

I have a guess at what this could be, though not sure if this still happens. Think it's related to differentiating between execution errors, disconnection errors, and actual breakages in nrepl.

@sanjayl doesn't seem to be active anymore, but tagging in case..

Will queue this up :)

from nrepl.

shen-tian avatar shen-tian commented on May 30, 2024

Finally had a dig into this one. I can replicate some behaviour (sending unencodable values, e.g. (Object.) in a message seem to cause a stall. This is not unique to the :value slot, though I think depending on where in the middleware stack this was done, print would have stringyfied any unencodable values in the :value slot. This is caused by how bencode/write-bencode works: it's recursive. Thus, it will start writing a map, before throwing an Exception that there's unecoded values inside. The fragment of a map, when sent, will cause the reader to stall waiting for "end of the map" that was never written.

  • I didn't observe the "nothing sent on the network" effect, but this could be explained by .flush not being called after write.
  • This did throw an exception for me on the middleware side, but not sure how visible this could have been from a client's point of view, as this error kind of wrecks the transport. This might also be affected by where the caught middleware is.

I checked the state of the library circa April 2017, and the analysis holds.

I've prepped a PR that makes the bencode writes fail cleaner.

BTW, does anyone know what's the deal with the -unencoded reading code here?

(fn-transport
#(let [payload (rethrow-on-disconnection s (bencode/read-bencode in))
unencoded (<bytes (payload "-unencoded"))
to-decode (apply dissoc payload "-unencoded" unencoded)]
(walk/keywordize-keys (merge (dissoc payload "-unencoded")
(when unencoded {"-unencoded" unencoded})
(<bytes to-decode))))

I can't find any reference to this in cider or cider-nrepl. What would write -unencoded?

from nrepl.

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.