Parcel calculation race condition #189
Closed
opened 2022-08-04 10:58:01 +02:00 by mpeltriaux
·
1 comment
189_Parcel_calculation_race_condition
Clear current reference
master
525_Deferred_message_loading
Docker
cicd
test-actions-runner
Clear current reference
1.28
1.27.2
1.27.1
1.27
1.26.4
1.26.3
1.26.2
1.26.1
1.26
1.25.1
1.25
1.24.1
1.24
1.23.1
1.23
1.22.1
1.22
1.21
1.20.2
1.20.1
1.20
1.19
1.18
1.17
1.16.1
1.16
1.15
1.14.2
1.14.1
1.14
1.13.10
1.13.9
1.13.8
1.13.7
1.13.6
1.13.5
1.13.4
1.13.3
1.13.2
1.13.1
1.13
1.12
1.11
1.10.1
1.10
1.9.12
1.9.11
1.9.10
1.9.9
1.9.8
1.9.7
1.9.6
1.9.5
v1.9.3
1.9.2
1.9.1
1.9
1.8
1.7
1.6
1.5
1.4.3
1.4.2
1.4.1
v1.3
v1.2
v1.1
v1.0
v0.6
v0.5
v0.4
v0.3.1
v0.3
v0.2
v0.1
Labels
Clear labels
backlog
bug
duplicate
enhancement
feature
help wanted
invalid
question
wontfix
MAUS - Pacht
bug
duplicate
enhancement
help wanted
in discussion
invalid
question
wontfix
Absolutely no priority, but maybe some day...
Something is not working
This issue or pull request already exists
Idea for existing feature
New feature
Need some help
Something is wrong
More information is needed
This won't be fixed
Issues für Maus-Pacht / Version processware
Something is not working
This issue or pull request already exists
New feature
Need some help
Something is wrong
More information is needed
This won't be fixed
priority
1
priority
2
priority
3
priority
4
priority
5
No labels
enhancement
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
mpeltriaux
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: IT-Naturschutz/konova#189
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Status quo
Parcel calculation runs in parallel celery worker processes. This ensures the calculation is performed on a background process, which does not delay the response of the client's foreground process, resulting in an unsatisfying user experience.
However, if a lot of calculations are performed at the same time (e.g. during migration but also possible on mass insertion via API), the same parcel could be created on the used
get_or_createmethod by two different worker processes.This results in a duplicates parcel entry. The next worker running
get_or_createwill fetch two different entries, which are basically identical. This will break the logic, since this is not supposed to happen.Enhancement
The
get_or_createcalls have to live in a mutexed method, so each getting-or-creating call will not run parallel but serial. There is a handy tutorial on the official celery documentation regarding this issue: https://docs.celeryq.dev/en/latest/tutorials/task-cookbook.htmlWe should implement this!
Merged in #193