Giter Club home page Giter Club logo

Comments (5)

jcmellado avatar jcmellado commented on July 26, 2024

As far as I can see connection errors are not handled and thrown to the global exception handler, which terminates the process. But in many cases it might be nice to support reconnecting.

Yes, but it seemed a bit hard to implement correctly to me, so I left out it from the very first version of the library. The main purpose of the library is implement the Redis protocol, of course.

If using redis as a single key/value cache... it would be preferred to reconnect and retry get/sets instead of crashing the entire process.

Indeed.

But note that the reconnection could not satisfy the client expectation when using the "pipelining" feature. And the reconnection should be disabled when using the "fire and forget" feature.

I think it's possible to handle errors by setting up a zone and handling the error, but:
This seems like an unfortunate way to this,
All pending commands are going to hang because the futures aren't resolved.
...

Well, the onError handler should be provided and a custom exception could be thrown. I saw that you already did that in your PR. I'll take a deeper look to it after.

from dartis.

jonasfj avatar jonasfj commented on July 26, 2024

But note that the reconnection could not satisfy the client expectation when using the "pipelining" feature. And the reconnection should be disabled when using the "fire and forget" feature.

Given that redis can be used for many different things: a simple cache (instead of memcached), session store, work-queue, pub-sub message exchanges. I would suggest that this library doesn't necessarily have to implement a reconnection strategy, since there is many different opinions on how to do this.

But exposing a manner in which errors can be handled is necessary for others to implement reconnection logic, on top of this library.

from dartis.

jcmellado avatar jcmellado commented on July 26, 2024

I merged #12, but I can not get it working on my local machine.

TimeoutException after 0:00:30.000000: Test timed out after 30 seconds.

I got this error on the two new tests added to client_test and connection_test.

Travis is working fine.

from dartis.

jonasfj avatar jonasfj commented on July 26, 2024

Hmm, I tried it on a cloud instance and I also get some timeouts...

I'm not exactly sure if there is a better way to do this... Maybe we should be piping manually and then break the pipe, it could be that calling destroy while something is being piped is undefined behavior.

Maybe sockets just behave differently on windows, I'm rather unfamiliar with Windows.

But in general, I find that there aren't many good ways to simulate flaky connections.

from dartis.

jcmellado avatar jcmellado commented on July 26, 2024

I can't get this working. Any idea?

from dartis.

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.