Skip to content

fix(qs-batches): retry running transactions that require db locks#736

Merged
m90 merged 2 commits into
mainfrom
fr/transaction-retry
Feb 7, 2024
Merged

fix(qs-batches): retry running transactions that require db locks#736
m90 merged 2 commits into
mainfrom
fr/transaction-retry

Conversation

@m90

@m90 m90 commented Feb 7, 2024

Copy link
Copy Markdown
Contributor

This is a fixup for #721

Apparently transactions that cannot acquire a lock now fail (which is expected), so we should retry them afterwards a couple of times before giving up. Laravel's DB::transaction can do this for us.

@tarrow tarrow left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me; I also glanced at the other 4 DB::transaction calls in this repo and I don't think this retry behaviour immediately needs to be added there

@m90

m90 commented Feb 7, 2024

Copy link
Copy Markdown
Contributor Author

I don't think this retry behaviour immediately needs to be added there

Yup, I would think we only need to retry when we actually lock. Else, the failure is very unlikely to succeed on second attempt.

@m90
m90 merged commit 70dcda9 into main Feb 7, 2024
@m90
m90 deleted the fr/transaction-retry branch February 7, 2024 12:25
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