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

user_profile.py create operation is not atomic #2058

Open
mikesmit opened this issue Dec 17, 2024 · 0 comments
Open

user_profile.py create operation is not atomic #2058

mikesmit opened this issue Dec 17, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@mikesmit
Copy link
Collaborator

https://github.com/PolicyEngine/policyengine-api/blob/master/policyengine_api/endpoints/user_profile.py#L19-L57

  1. Does a select to see if a user already exists and then
  2. Does an insert if not.

This is not atomic so if I call it twice quickly I can get intermittently different behavior.

I am creating this issue to track the problem and come back to fix it later after addressing #1989

@mikesmit mikesmit self-assigned this Dec 17, 2024
@mikesmit mikesmit removed their assignment Jan 6, 2025
@nikhilwoodruff nikhilwoodruff added the bug Something isn't working label Feb 3, 2025
@nikhilwoodruff nikhilwoodruff changed the title user_profile.py create operation is not atomic user_profile.py create operation is not atomic Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants