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

Race condition with fund update #230

Open
yuriytkach opened this issue Dec 7, 2023 · 0 comments
Open

Race condition with fund update #230

yuriytkach opened this issue Dec 7, 2023 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@yuriytkach
Copy link
Owner

If two http requests come to track donation simultaneously it can start 2 lambda functions in parallel. Then we'll have a race condition in updating fund total - both lambdas will read the current fund total, then add a sum and then write. This can lead to one write overriding the other. We need to resolve that with DynamoDB conditional writes.

We could have used sqs to publish event there and then process them one by one, but that will require to have SQS. If we're still OK and within the processing time limit from Monobank to perform conditional write, then that could be easier to implement.

@yuriytkach yuriytkach added bug Something isn't working help wanted Extra attention is needed labels Dec 7, 2023
@yuriytkach yuriytkach pinned this issue Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant