ruma / homeserver

A Matrix homeserver written in Rust.

Home Page:https://www.ruma.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Retrying failed transactions

jimmycuadra opened this issue · comments

Continued from #121.

When a database transaction fails, it might be a good idea to retry it. Some initial thoughts and questions:

  1. What are the most common reasons a transaction would fail?
  2. Do we want to retry all failed transactions or only when the failure was something we know has a possibility of working on another try (e.g. deadlocks)?
  3. What should the limit on the number of retries be?
  4. Should retry logic be part of application logic or encapsulated as part of the database layer itself? (I'm not sure if Diesel has any sort of automatic retrying feature that we might leverage, if we want to go for the latter.)