Comments (8)
It seems working well.
Looking forward to the next release.
from aredis.
Maybe there is another way to solve this problem. Add a state
property to the Connection
class, and mark a connection as busy
, before sending a request and mark it as idle
after handled the response. Before sending a new command, check the status
.
from aredis.
That sounds reasonable, would you like to make a pr? Or i will try to fix this problem this weekend
from aredis.
@myrfy001
Do you think it should be regarded as reusable if a connection is broken(stop before or during reading response)?
For now i try to fix this issue by adding attribute to connection to indicate if it is waiting for response, if it is waiting then connection will be disconnected and never put back to available connection list again. The parse response error 'int' object has no attribute 'decode'
is fixed and never raised again. (but TimeoutError
raised by asyncio_timeout is still there)
But i am not sure if this kind of connection should be clean and reused again.
Looking forward to your opinion.
from aredis.
I think close the connection is the safest way. Think this situation: because of network delay, or because of large responses by bulk execution, the response of the pervious command may arrive after cleaning the buffer. So, close the connection is a safe way to avoid this. Besides, this problem is an edge case so it's seldom happens, so, there won't be a lot of reconnect action that will lower the efficiency.
from aredis.
That's good, this patch will be tested and merge to master soon.
from aredis.
@myrfy001
Patch is already merged to master and you can try it with
pip install git+https://github.com/NoneGG/aredis.git
If there are other problems please tell me~
from aredis.
@myrfy001
May i close this issue?
from aredis.
Related Issues (20)
- ERROR sending "cluster slots" command to redis server when I set a key
- xgroup_create need a key word param such as 'create_if_not_exit' HOT 1
- Where to fill in the password? Don't you have a password for Redis? HOT 1
- Project Dead? HOT 3
- LockError("Cannot release a lock that's no longer owned") HOT 1
- SSL Cert Reqs not being used as intended
- create_unix_connection() got an unexpected keyword argument 'loop' (Port to python 3.10) HOT 1
- spop(): aredis.exceptions.RedisClusterException: Too many connections HOT 1
- Forked repository HOT 1
- create_connection() got an unexpected keyword argument 'loop'
- StrictRedisCluster client hangs with AWS elasticache - connection pool remains uninitialized HOT 1
- Exception: AttributeError: 'list' object has no attribute 'decode' HOT 1
- How to setup SSL=True and password with redis cluster ?
- WARNING: aredis 1.1.8 does not provide the extra 'hiredis'
- rename command decoding error
- TypeError: BaseEventLoop.create_connection() got an unexpected keyword argument 'loop' HOT 4
- `transaction` in cluster mode unusable HOT 1
- Add username to StrictRedis connection
- 哨兵模式怎么连接啊
- This Library is Deprecated
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 aredis.