Code Monkey home page Code Monkey logo

Comments (8)

myrfy001 avatar myrfy001 commented on May 20, 2024 1

It seems working well.
Looking forward to the next release.

from aredis.

myrfy001 avatar myrfy001 commented on May 20, 2024

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.

NoneGG avatar NoneGG commented on May 20, 2024

That sounds reasonable, would you like to make a pr? Or i will try to fix this problem this weekend

from aredis.

NoneGG avatar NoneGG commented on May 20, 2024

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

myrfy001 avatar myrfy001 commented on May 20, 2024

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.

NoneGG avatar NoneGG commented on May 20, 2024

That's good, this patch will be tested and merge to master soon.

from aredis.

NoneGG avatar NoneGG commented on May 20, 2024

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

NoneGG avatar NoneGG commented on May 20, 2024

@myrfy001
May i close this issue?

from aredis.

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.