Skip to content
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

Don't call backend.set when backend.get returns None and default value is None #444

Closed
wants to merge 2 commits into from

Conversation

i2xS
Copy link

@i2xS i2xS commented Mar 3, 2021

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
Copy link

codecov bot commented Mar 3, 2021

Codecov Report

Merging #444 (bd09021) into master (a16cca3) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           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 data
Powered by Codecov. Last update a16cca3...bd09021. Read the comment docs.

Copy link
Member

@jezdez jezdez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please provide a test case to make sure this won't break again.

@camilonova
Copy link
Member

@i2xS please include a test so we can merge this.

@camilonova
Copy link
Member

@i2xS should we close this one?

@MichaelDanielTom
Copy link

Any reason not to merge this? Seems like this should be the desired behavior, and it's still relevant given this.

@camilonova
Copy link
Member

@i2xS @MichaelDanielTom can you provide a test so we can merge this?

@camilonova camilonova closed this Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants