mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #26059 from rails/rename-deadlock-detected-to-deadlocked
The problem isn't the detection but the deadlock itself
This commit is contained in:
commit
320d40123a
5 changed files with 8 additions and 8 deletions
|
@ -753,7 +753,7 @@ module ActiveRecord
|
|||
when ER_DATA_TOO_LONG
|
||||
ValueTooLong.new(message)
|
||||
when ER_LOCK_DEADLOCK
|
||||
DeadlockDetected.new(message)
|
||||
Deadlocked.new(message)
|
||||
else
|
||||
super
|
||||
end
|
||||
|
|
|
@ -422,7 +422,7 @@ module ActiveRecord
|
|||
when SERIALIZATION_FAILURE
|
||||
SerializationFailure.new(message)
|
||||
when DEADLOCK_DETECTED
|
||||
DeadlockDetected.new(message)
|
||||
Deadlocked.new(message)
|
||||
else
|
||||
super
|
||||
end
|
||||
|
|
|
@ -300,9 +300,9 @@ module ActiveRecord
|
|||
class SerializationFailure < TransactionRollbackError
|
||||
end
|
||||
|
||||
# DeadlockDetected will be raised when a transaction is rolled
|
||||
# Deadlocked will be raised when a transaction is rolled
|
||||
# back by the database when a deadlock is encountered.
|
||||
class DeadlockDetected < TransactionRollbackError
|
||||
class Deadlocked < TransactionRollbackError
|
||||
end
|
||||
|
||||
# IrreversibleOrderError is raised when a relation's order is too complex for
|
||||
|
|
|
@ -27,8 +27,8 @@ module ActiveRecord
|
|||
@connection.drop_table 'samples', if_exists: true
|
||||
end
|
||||
|
||||
test "raises DeadlockDetected when a deadlock is encountered" do
|
||||
assert_raises(ActiveRecord::DeadlockDetected) do
|
||||
test "raises Deadlocked when a deadlock is encountered" do
|
||||
assert_raises(ActiveRecord::Deadlocked) do
|
||||
s1 = Sample.create value: 1
|
||||
s2 = Sample.create value: 2
|
||||
|
||||
|
|
|
@ -58,9 +58,9 @@ module ActiveRecord
|
|||
end
|
||||
end
|
||||
|
||||
test "raises DeadlockDetected when a deadlock is encountered" do
|
||||
test "raises Deadlocked when a deadlock is encountered" do
|
||||
with_warning_suppression do
|
||||
assert_raises(ActiveRecord::DeadlockDetected) do
|
||||
assert_raises(ActiveRecord::Deadlocked) do
|
||||
s1 = Sample.create value: 1
|
||||
s2 = Sample.create value: 2
|
||||
|
||||
|
|
Loading…
Reference in a new issue