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

wrap research_data row addition in critical section #4412

Merged
merged 2 commits into from
Oct 14, 2024

Conversation

pbugni
Copy link
Collaborator

@pbugni pbugni commented Oct 14, 2024

wrap research_data row addition in critical section, keyed on unique constraint, as we do rarely experience asynchronous collisions.

this is intended to prevent exceptions such as the following, seen once during the initial population of 100K rows:

Unexpected exception in `cache_research_data_task` on 231 : (psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint "ix_research_data_questionnaire_response_id"
DETAIL:  Key (questionnaire_response_id)=(97480) already exists.

ivan-c and others added 2 commits October 10, 2024 10:44
…constraint, as we do rarely experience asynchronous collisions.
@pbugni pbugni requested a review from ivan-c October 14, 2024 18:56
@pbugni pbugni changed the base branch from develop to master October 14, 2024 18:59
@pbugni pbugni merged commit 8cd97f0 into master Oct 14, 2024
2 checks passed
@pbugni pbugni deleted the feature/critical-section_research-data-add branch October 14, 2024 20:43
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.

2 participants