From 1c5cf1c88cace42869add2258cb636a2cc7163e2 Mon Sep 17 00:00:00 2001 From: wowinter13 Date: Tue, 28 Jan 2025 15:48:45 +0100 Subject: [PATCH] Rephrase sentences --- diesel_migrations/src/migration_harness.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/diesel_migrations/src/migration_harness.rs b/diesel_migrations/src/migration_harness.rs index 6178638a084b..e36aad2f0f0f 100644 --- a/diesel_migrations/src/migration_harness.rs +++ b/diesel_migrations/src/migration_harness.rs @@ -32,16 +32,14 @@ pub trait MigrationHarness { /// Execute all unapplied migrations for a given migration source /// - /// # Concurrent Usage - /// This method may be called concurrently from multiple processes. However: - /// * Only one process will successfully apply each migration - /// * Other concurrent processes may receive database lock errors - /// * Processes that start after successful migration will find no pending migrations - /// * No migrations will be applied more than once + /// # Concurrent Usage Safety + /// This method can be safely called concurrently from multiple processes. The behavior is as follows: + /// + /// * All migrations are applied atomically by the first process that successfully acquires the database lock + /// * Concurrent processes attempting to run migrations while the lock is held will receive a "database is locked" error + /// * Processes that start after successful migration completion will find no pending migrations and complete successfully + /// * Each migration is guaranteed to be applied exactly once /// - /// For SQLite databases, concurrent calls may result in "database is locked" errors - /// due to SQLite's locking mechanism. Applications should be prepared to handle - /// these errors and potentially retry the operation. fn run_pending_migrations>( &mut self, source: S,