Comments (5)
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.
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.
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.
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.
I can't get this working. Any idea?
from dartis.
Related Issues (20)
- Full support for PubSub HOT 2
- Adding a custom exception for watch
- "pubsub.stream.listen(print, onDone: (){print('done')}). " the "onDone:" never work. HOT 1
- hgetall broken? HOT 3
- how to reconnect when needed? HOT 3
- Connection with password HOT 2
- Supply password with PubSub HOT 6
- Add support for Redis streams HOT 1
- Add support for ACL commands - Redis 6 HOT 3
- publish problem HOT 2
- Should support connectionString containing password HOT 3
- How do we connect to an SSL port?
- Add support for Web HOT 1
- Migrate to null safety HOT 2
- Is there a plan to migrate to dart null safety? HOT 18
- Can pipeline have unwanted results? HOT 2
- Can I use RedisSearch? HOT 2
- tls and rediss:// suppot?
- How to reconnect when connection is stale? HOT 3
- Socket flush?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dartis.