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

Make pool read-only, with a single write connection. #1517

Merged
merged 46 commits into from
Feb 3, 2025
Merged

Conversation

codabrink
Copy link
Contributor

No description provided.

@codabrink codabrink force-pushed the coda/write-flag branch 3 times, most recently from c5ed9b2 to d547dc8 Compare January 23, 2025 17:22
xmtp_mls/src/storage/encrypted_store/db_connection.rs Outdated Show resolved Hide resolved
xmtp_mls/src/storage/encrypted_store/db_connection.rs Outdated Show resolved Hide resolved
xmtp_mls/src/groups/mod.rs Outdated Show resolved Hide resolved
xmtp_mls/src/storage/encrypted_store/db_connection.rs Outdated Show resolved Hide resolved
@codabrink codabrink marked this pull request as draft February 3, 2025 18:48
@codabrink codabrink marked this pull request as ready for review February 3, 2025 21:01
// wasm does not have threads
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
#[cfg(not(target_arch = "wasm32"))]
async fn test_transaction_rollback() {
Copy link
Contributor Author

@codabrink codabrink Feb 3, 2025

Choose a reason for hiding this comment

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

Deleted this test since the barriers in this test were trying to force something that should be impossible now and was causing a deadlock.

Copy link
Contributor

@insipx insipx Feb 3, 2025

Choose a reason for hiding this comment

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

right, because the barriers would never progress since the transaction never finishes. So we would only deadlock IRL if we somehow had a transaction that never finishes or infinity-loops, which shouldn't happen w/o async or a bug


let conn = self.conn_ref();
let _guard = conn.start_transaction::<Db>()?;
Copy link
Contributor

@insipx insipx Feb 3, 2025

Choose a reason for hiding this comment

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

now that async transactions are gone and our connection is a mutex, can we use diesels transaction function?

@insipx
Copy link
Contributor

insipx commented Feb 3, 2025

Looks good!

@codabrink codabrink enabled auto-merge (squash) February 3, 2025 21:56
@codabrink codabrink merged commit ae4eb9c into main Feb 3, 2025
11 checks passed
@codabrink codabrink deleted the coda/write-flag branch February 3, 2025 22:08
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.

3 participants