django-constance
django-constance copied to clipboard
Don't call backend.set when backend.get returns None and default value is None
Hi there!
Preconditions: Any constance variable default value: None current value: None
Reading value through config.VALUE_NAME leads to backend.set('VALUE_NAME', None) call, which updates None to None.
This behaviour led us to database failure on production when 80 simultaneous value reads happen, which eventually led to simultaneous writes and deadlocks. Deadlocks led to service restarts, emitting new connections to database and new deadlocks.
Codecov Report
Merging #444 (bd09021) into master (a16cca3) will not change coverage. The diff coverage is
100.00%.
@@ Coverage Diff @@
## master #444 +/- ##
=======================================
Coverage 82.11% 82.11%
=======================================
Files 15 15
Lines 548 548
Branches 88 88
=======================================
Hits 450 450
Misses 65 65
Partials 33 33
| Impacted Files | Coverage Δ | |
|---|---|---|
| constance/base.py | 86.95% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update a16cca3...bd09021. Read the comment docs.
@i2xS please include a test so we can merge this.
@i2xS should we close this one?
Any reason not to merge this? Seems like this should be the desired behavior, and it's still relevant given this.
@i2xS @MichaelDanielTom can you provide a test so we can merge this?