Repository navigation
fix: race condition where _template remains UNSET - #1588
JuroOravec merged 3 commits into
Conversation
Two fixes: 1. component_media.py: Retry loading if _template is still UNSET 2. template.py: Treat UNSET as None when reading _template
Performance Benchmark ResultsComparing PR changes against master branch: Benchmarks that have stayed the same:
|
Performance Benchmark ResultsComparing PR changes against master branch: Benchmarks that have stayed the same:
|
|
@oliverhaas Thanks for looking into this and fixing it! The only Django project I worked on was single thread WSGI app, and I didn't work with multithreaded Python programs yet, so issues like this can fall through the cracks. So I appreciate your help. I've fixed linter errors + bit of cleanup. The test does actually capture the error, so I think it's fine keeping it :) |
Performance Benchmark ResultsComparing PR changes against master branch: Benchmarks that have stayed the same:
|
No worries. I'm actually not happy about our production setup. Threading causes a couple annoying issues, but also without it we have other downsides. |
See #1587.
Basically the idea is here to change the order of the logic a little bit, so the idempotent loading might happen twice, but a race condition does not lead to an error.
Test is just for illustration. I would not merge the test.