Skip to content

[TRI-3867] Updating lots of environment variables at once fails with a transaction timeout #1411

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

Closed
matt-aitken opened this issue Oct 15, 2024 · 2 comments
Labels
bug Something isn't working linear Urgent Created by Linear-GitHub Sync
Milestone

Comments

@matt-aitken
Copy link
Member

matt-aitken commented Oct 15, 2024

When we bulk upsert environment variables we wrap the entire thing in a database transaction. If there are a lot of env vars (e.g. more than 100) then the transaction can timeout.

You can see in the current code that the transaction is wrapped around the for loop:

const result = await $transaction(this.prismaClient, async (tx) => {

Instead we should move that transaction inside the for loop. We still need the transaction so we always create all the resources for each env var and don't leave any of them dangling.

TRI-3867

@matt-aitken matt-aitken changed the title Updating lots of environment variables at once fails with a transaction timeout [TRI-3867] Updating lots of environment variables at once fails with a transaction timeout Oct 15, 2024
@matt-aitken matt-aitken added bug Something isn't working linear labels Oct 15, 2024
@matt-aitken matt-aitken added this to the v.68 milestone Oct 15, 2024
@matt-aitken matt-aitken added the Urgent Created by Linear-GitHub Sync label Oct 15, 2024
@yadavshubham01
Copy link
Contributor

hey @matt-aitken working in this issue

@yadavshubham01
Copy link
Contributor

@matt-aitken Checkout this #1413

@nicktrn nicktrn closed this as completed Oct 17, 2024
@matt-aitken matt-aitken modified the milestones: v.68, v.69 Oct 20, 2024
@matt-aitken matt-aitken modified the milestones: v.69, v.70 Oct 28, 2024
@matt-aitken matt-aitken modified the milestones: v.70, v.71, v.72 Nov 4, 2024
@matt-aitken matt-aitken modified the milestones: v.72, v.73, v.74 Nov 18, 2024
@matt-aitken matt-aitken modified the milestones: v.74, v.75, v.76 Dec 2, 2024
@matt-aitken matt-aitken modified the milestones: v.76, v.77, v.78 Dec 16, 2024
@matt-aitken matt-aitken modified the milestones: v.78, v.79 Dec 30, 2024
@matt-aitken matt-aitken modified the milestones: v.84, v.85 Feb 10, 2025
@matt-aitken matt-aitken modified the milestones: v.85, v.86, v.87 Feb 17, 2025
@matt-aitken matt-aitken modified the milestones: v.87, v.88, v.89 Mar 3, 2025
@matt-aitken matt-aitken modified the milestones: v.89, v.90 Mar 17, 2025
@matt-aitken matt-aitken modified the milestones: v.90, v.91 Mar 24, 2025
@matt-aitken matt-aitken modified the milestones: v.91, v.92, v.93 Mar 31, 2025
@matt-aitken matt-aitken modified the milestones: v.93, v.94, v.95 Apr 13, 2025
@matt-aitken matt-aitken modified the milestones: v.95, v.96, v.97 Apr 27, 2025
@matt-aitken matt-aitken modified the milestones: v.97, v.98, v.99 May 11, 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 linear Urgent Created by Linear-GitHub Sync
Projects
None yet
Development

No branches or pull requests

3 participants