Wrap exception raised by backend when releasing lock, and attach generated result to it.
Haochuan Guo
Branch: wooparadog/dogpile.core:abstract-release-exception
Branch: zzzeek/dogpile.core:master
Declined
Declined pull request
After some thought, this use case is indeed some weird, I'm trying to fix it on our end. So I'm cancelling this pull request. @Mike, Thanks so much for your opinions and patience.
Closed by: Haochuan Guo·2014-08-01
For #22 of dogpile.cache, aims to raise exception when backend fails to release lock and keep track of generated result at the same time.
Refactor
Lock._enter_create
.Add
NeedAsyncRegenerationException
, which would trigger an async regeneration. It also hold anexisting_value
for results generated at the moment.Add
LockReleaseException
, wraps any exception raised by backend when releasing lock. It also contains results that would be returned if no exception is raised.