を超えて、私はsidekiq処理時間のかかるタスクを使用しますが、sidekiqにエラーを記録:のActiveRecord :: StatementInvalid:Mysql2 ::エラー:ロック待ちタイムアウトが私のレールプロジェクトで
ActiveRecord::StatementInvalid: Mysql2::Error: Lock wait timeout exceeded; try restarting transaction: UPDATE `marker_layers` SET `show_fields` = 'title,desc', `sort_col` = 'title,desc', `updated_at` = '2016-05-17 07:36:02' WHERE `marker_layers`.`id` = 16021210
Processor: iZ23edse84Z:29310
# Options here can still be overridden by cmd line args.
# setsid sidekiq -d -C config/sidekiq.yml -e production
---
:concurrency: 5
:pidfile: tmp/pids/sidekiq.pid
:logfile: log/sidekiq.log
staging:
:concurrency: 10
production:
:concurrency: 40
:queues:
- ['critical', 3]
- ['default', 2]
- ['low', 1]
database.ymlの
production:
adapter: mysql2
encoding: utf8mb4
collation: utf8mb4_bin
reconnect: false
database: database_name
pool: 48
username: password
password: password
host: locahost
ほとんどの場合、複数の従業員は同じデータベース行を更新しようとしますが、アクセスを待つ間はタイムアウトします。あなたの情報から、我々はもっと多くを伝えることはできません。競合状態のコードを再調査し、デッドロックがどこから来たのかを確認する必要があります。 – averell
http://stackoverflow.com/questions/6000336/how-to-debug-lock-wait-timeout-exceeded役に立った –