GithubHelp home page GithubHelp logo

Comments (8)

sh4nks avatar sh4nks commented on July 28, 2024 1

Looks like it's our problem now :P

from flask-caching.

sh4nks avatar sh4nks commented on July 28, 2024

this is a problem with werkzeugs filesystem cache problem and not a flask-caching ones.

as you can see here, delete_many is just a proxy function to the underlying backend.

from flask-caching.

johaven avatar johaven commented on July 28, 2024

That's right I report on the werkzeug side

from flask-caching.

buckley-w-david avatar buckley-w-david commented on July 28, 2024

@sh4nks I'll take a go at this issue, but before I do it's probably a good idea to discuss what the desired behavior is.

Right now the behavior of the delete_many method is actually inconsistent, in the cases where the cache just uses the inherited delete_many, the evaluation short circuits on a failure as this issue describes, but on classes that have overridden the method it'll be down to how it's implemented.

It's pretty simply to just change the delete_many method in the BaseCache to not short circuit, but the question is that this is actually a potentially breaking change, as it is possible that some user of the library is relying on this behavior.

That suggests that the addition of the ignore_errors=False flag to the method is a good one to resolve this, as it would allow the improved behavior without risking breaking existing implementations, but that has some strange implications on other cache objects (Like Memcached, that uses the underlying batch delete method to improve performance) of also having to honor the flag.

Do we consider the short circuit behavior a bug? It is unspecified behavior, so people really shouldn't have been relying on it. If we do consider it a bug, we wouldn't have to worry about the additional overhead of new deletion logic and impacting the performance of specialized delete methods.

from flask-caching.

sh4nks avatar sh4nks commented on July 28, 2024

@buckley-w-david sorry for my late response - I am very busy with uni stuff and have barely time to maintain my personal projects.. anyway, if you are still interested - go for it! :)

I like the idea of adding a ignore_errors=False flag but I don't understand why there would be any implications if it is by default False?

I do, however, consider it a bug so we wouldn't have to worry about new deletion logic etc. I think this might even justify a major version pump to 2.0.

from flask-caching.

buckley-w-david avatar buckley-w-david commented on July 28, 2024

No worries, I'm in the same boat.

The issue I was thinking of back then I think was that since each of the cache's current behavior is inconsistent (some stop on first error some don't), just throwing in a ignore_errors=False would change existing behavior, for example the memcached cache is implemented via a batch command and so doesn't suffer from the stopping early bug.

What I didn't think of at the time was that each of the methods could just be given the default value to match their current behavior, which resolves that.

from flask-caching.

sh4nks avatar sh4nks commented on July 28, 2024

Hehe. Yeah, then lets do it this way :)

from flask-caching.

johaven avatar johaven commented on July 28, 2024

with a little delay, thank you :)

from flask-caching.

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.