-
Notifications
You must be signed in to change notification settings - Fork 133
Closed
Description
Sometimes when committing a transaction (https://github.com/blackbeam/mysql_async/blob/master/src/queryable/transaction.rs#L179), it commit fails because of a mysql deadlock. When this happens you must explicitly rollback the changes, otherwise when creating a new transaction it will be nested.
This is checked in the code, but somehow it does not work and I could not find any tests in it.
I must wrap my code from
trx.commit().await.map(|_| result).map_err(Into::into)
to
match trx.commit().await {
Ok(_) => {
Ok(result)
},
Err(e) => {
conn.query_drop("ROLLBACK;").await?;
Err(e.into())
}
}
See stalwartlabs/stalwart#1271 for more details.
Can you please fix this?
Thank you!
Metadata
Metadata
Assignees
Labels
No labels