aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2017-11-27 10:30:25 +0900
committerGitHub <noreply@github.com>2017-11-27 10:30:25 +0900
commitad0630f0ae2d65bc0adda4097af8009a985b6f15 (patch)
treeac8f67af75f36826bb74cc09b78fa396d2f744ce /activerecord/lib/active_record
parentb1f140ef2e5af605ea12d8ee1c932eaf728a398d (diff)
downloadrails-ad0630f0ae2d65bc0adda4097af8009a985b6f15.tar.gz
rails-ad0630f0ae2d65bc0adda4097af8009a985b6f15.tar.bz2
rails-ad0630f0ae2d65bc0adda4097af8009a985b6f15.zip
Rename `TransactionTimeout` to more descriptive `LockWaitTimeout` (#31223)
Since #31129, new error class `StatementTimeout` has been added. `TransactionTimeout` is caused by the timeout shorter than `StatementTimeout`, but its name is too generic. I think that it should be a name that understands the difference with `StatementTimeout`.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb2
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb2
-rw-r--r--activerecord/lib/active_record/errors.rb4
3 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
index 0e552dba95..77ccac54bf 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
@@ -660,7 +660,7 @@ module ActiveRecord
when ER_LOCK_DEADLOCK
Deadlocked.new(message)
when ER_LOCK_WAIT_TIMEOUT
- TransactionTimeout.new(message)
+ LockWaitTimeout.new(message)
when ER_QUERY_TIMEOUT
StatementTimeout.new(message)
else
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
index 1739c288b6..489feadb00 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -418,7 +418,7 @@ module ActiveRecord
when DEADLOCK_DETECTED
Deadlocked.new(message)
when LOCK_NOT_AVAILABLE
- TransactionTimeout.new(message)
+ LockWaitTimeout.new(message)
when QUERY_CANCELED
StatementTimeout.new(message)
else
diff --git a/activerecord/lib/active_record/errors.rb b/activerecord/lib/active_record/errors.rb
index 7382879fce..89e777ffc3 100644
--- a/activerecord/lib/active_record/errors.rb
+++ b/activerecord/lib/active_record/errors.rb
@@ -335,8 +335,8 @@ module ActiveRecord
class IrreversibleOrderError < ActiveRecordError
end
- # TransactionTimeout will be raised when lock wait timeout exceeded.
- class TransactionTimeout < StatementInvalid
+ # LockWaitTimeout will be raised when lock wait timeout exceeded.
+ class LockWaitTimeout < StatementInvalid
end
# StatementTimeout will be raised when statement timeout exceeded.