Code Monkey home page Code Monkey logo

Comments (13)

jonathanslenders avatar jonathanslenders commented on May 9, 2024 1

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.

jonathanslenders avatar jonathanslenders commented on May 9, 2024

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.

adamrothman avatar adamrothman commented on May 9, 2024

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.

jonathanslenders avatar jonathanslenders commented on May 9, 2024

It would be great if you could also create an issue for the other trace. It could help. Thanks!

from asyncio-redis.

adamrothman avatar adamrothman commented on May 9, 2024

@jonathanslenders done (#99); thanks for looking into these!

from asyncio-redis.

jonathanslenders avatar jonathanslenders commented on May 9, 2024

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.

adamrothman avatar adamrothman commented on May 9, 2024

@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.

jonathanslenders avatar jonathanslenders commented on May 9, 2024

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.

adamrothman avatar adamrothman commented on May 9, 2024

@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.

adamrothman avatar adamrothman commented on May 9, 2024

@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.

adamrothman avatar adamrothman commented on May 9, 2024

Er, actually, I'm going to leave these open until the branch is merged.

from asyncio-redis.

jonathanslenders avatar jonathanslenders commented on May 9, 2024

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.

jonathanslenders avatar jonathanslenders commented on May 9, 2024

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)

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.