Comments (13)
Hi @adamrothman,
This is clearly a bug. Thanks for reporting it!
Right now, I have no idea yet what's going on, but I'm looking into it.
from asyncio-redis.
One question. Are you using transactions?
If so, the bug could be related to that. (If not, I know I have to look into something else. -- It's not that obvious.)
from asyncio-redis.
Not in this case, no (but I have another stack trace I can open an issue for that I think is related to transactions). This is the source for the _decrement_open_connections
:
async def _decrement_open_connections(self):
decr_result = await self.redis.decr(self._open_connections_key)
if decr_result < 0:
# Key doesn't exist (or it expired); delete it
await self.redis.delete([self._open_connections_key])
return 0
return decr_result
from asyncio-redis.
It would be great if you could also create an issue for the other trace. It could help. Thanks!
from asyncio-redis.
@jonathanslenders done (#99); thanks for looking into these!
from asyncio-redis.
Hi @adamrothman,
I could not reproduce any of the above issues, but could reproduce a very similar condition. Apparently, transactions were prone to race conditions, when they were started from different coroutines. (Which happened once in a while.)
This fix was not as easy as I thought in the first place, but I think, I have a working fix:
#100
Basically, I had to use an asyncio.Lock
at the right places.
In my tests, no crashes happened anymore, and all the unit tests succeed. Do you have any possibility to test this branch?
from asyncio-redis.
@jonathanslenders it makes sense to me that your fix would address #99, but are you saying it solves this issue as well? We should be able to test out your branch; I'll deploy it tomorrow and keep you posted on the results.
from asyncio-redis.
Yes, I think that it does and they are caused by the same issue. Not 100% sure, but it definitely makes sense to me. Let me know if it works or not.
from asyncio-redis.
@jonathanslenders We have been running your patched branch since Monday – haven't seen any of this crash or the other. I'll leave it up to you whether to close the issues or seek further confirmation.
from asyncio-redis.
@jonathanslenders I am satisfied that the patch has fixed our issues. I'll close this and the other issue – feel free to merge #100. Any idea when the patch will make it into an official release?
from asyncio-redis.
Er, actually, I'm going to leave these open until the branch is merged.
from asyncio-redis.
Hi @adamrothman,
I will try to publish a new release this weekend.
Thanks again for reporting the issue and trying out the fix!
from asyncio-redis.
Hi @adamrothman,
#100 has been merged and it has been released on Pypi: https://pypi.python.org/pypi/asyncio_redis/
So closing this. Please let me know if you experience further issues.
from asyncio-redis.
Related Issues (20)
- ZRangeReply do not have aslist method
- Using context managers HOT 1
- How to release connection from subscribe HOT 1
- Broken on python 3.7.0 HOT 4
- The right way to share the returned connection.
- Unable to turn off auto_reconnect
- Deprecation warning for formatargspec in Python3.7 HOT 1
- Function `asyncio_redis.Connection.create()` hangs if connection can't be established HOT 2
- Python 3.8 DeprecationWarnings; drop support for legacy Python HOT 3
- Future and roadmap of asyncio-redis HOT 5
- Difference between aioredis?
- Release new version? HOT 4
- Update documentation HOT 1
- SPOP [count] argument.
- intersphinx looks for implementation modules
- asyncio_redis should wait for server restart
- Adding python types HOT 1
- Missing ignore_subscribe_messages equivalent HOT 1
- Proposing a PR to fix a few small typos
- Async Class Constructors HOT 4
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 asyncio-redis.