-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Cache] Allow decorating each cache.pool
as debug adapters
#42241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hey! To help keep things organized, we don't allow "Draft" pull requests. Could you please click the "ready for review" button or close this PR and open a new one when you are done? Note that a pull request does not have to be "perfect" or "ready for merge" when you first open it. We just want it to be ready for a first review. Cheers! Carsonbot |
cache.pool
as debug adapterscache.pool
as debug adapters
That's an interesting approach, but to be honest I had another one in mind: That would give better DX, by giving proper error messages. |
Closing in favor of #43148 |
…ion fails (nicolas-grekas) This PR was merged into the 5.4 branch. Discussion ---------- [Cache] Throw ValueError in debug mode when serialization fails | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | yes | Deprecations? | - | Tickets | Fix #41685 | License | MIT | Doc PR | - This feature allows spotting mistakes at the dev stage when trying to store unserializable objects (typically a closure) into a cache. This PR replaces #42241 with a simpler and more focused approach: here we fail via a simple `ValueError`, which won't get caught by any try/catch into the Cache component, and we fail only when serialization fails - not on any failures of cache pool methods. Commits ------- 0d3ede7 [Cache] Throw ValueError in debug mode when serialization fails
DebugAdapter
to throw exception on failing savecache.exception_on_save
as parameter to configure the feature@nicolas-grekas could you provide some initial feedback on whether this implementation is in the right direction?