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

[production][unknown] PG::TRDeadlockDetected: ERROR: deadlock detected DETAIL: Process 5890 waits for ShareLock on tr... #220

Open
dwilkie opened this issue Aug 22, 2015 · 0 comments

Comments

@dwilkie
Copy link
Owner

dwilkie commented Aug 22, 2015

See this exception on Errbit

PG::TRDeadlockDetected: ERROR: deadlock detected

DETAIL: Process 5890 waits for ShareLock on transaction 7964377; blocked by process 5889.
Process 5889 waits for ShareLock on transaction 7964625; blocked by process 5890.
HINT: See server log for query details.
CONTEXT: while rechecking updated tuple (1295,113) in relation "users"

Summary

Where

unknown

Occured

Aug 22 1:14pm

Similar

0

Params

{
  "args" => "[\"SMART\", \"85510883079\", \"2442\", \"RANY jos nak nov na\", \"0\", \"1\", \"1\"]",
  "class" => "MoMessageReceivedJob",
  "error_class" => "ActiveRecord::StatementInvalid",
  "error_message" => "PG::TRDeadlockDetected: ERROR:  deadlock detected\nDETAIL:  Process 5890 waits for ShareLock on transaction 7964377; blocked by process 5889.\nProcess 5889 waits for ShareLock on transaction 7964625; blocked by process 5890.\nHINT:  See server log for query details.\nCONTEXT:  while rechecking updated tuple (1295,113) in relation \"users\"\n: UPDATE \"users\" SET \"active_chat_id\" = $1, \"updated_at\" = $2 WHERE \"users\".\"id\" = $3",
  "failed_at" => "1440224063.539458",
  "queue" => "urgent",
  "retry" => "true",
  "retry_count" => "0",
  "vars" => nil
}

Session

{
}

Backtrace

606:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb -> **exec_prepared**
606:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb -> **block in exec_cache**
473:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract_adapter.rb -> **block in log**
20:  [GEM_ROOT]/gems/activesupport-4.2.3/lib/active_support/notifications/instrumenter.rb -> **instrument**
467:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract_adapter.rb -> **log**
605:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb -> **exec_cache**
589:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb -> **execute_and_clear**
173:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/connection_adapters/postgresql/database_statements.rb -> **exec_delete**
114:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb -> **update**
14:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/query_cache.rb -> **update**
88:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/relation.rb -> **_update_record**
515:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/persistence.rb -> **_update_record**
79:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/locking/optimistic.rb -> **_update_record**
128:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/attribute_methods/dirty.rb -> **_update_record**
310:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/callbacks.rb -> **block in _update_record**
115:  [GEM_ROOT]/gems/activesupport-4.2.3/lib/active_support/callbacks.rb -> **call**
115:  [GEM_ROOT]/gems/activesupport-4.2.3/lib/active_support/callbacks.rb -> **call**
553:  [GEM_ROOT]/gems/activesupport-4.2.3/lib/active_support/callbacks.rb -> **block (2 levels) in compile**
503:  [GEM_ROOT]/gems/activesupport-4.2.3/lib/active_support/callbacks.rb -> **call**
503:  [GEM_ROOT]/gems/activesupport-4.2.3/lib/active_support/callbacks.rb -> **call**
88:  [GEM_ROOT]/gems/activesupport-4.2.3/lib/active_support/callbacks.rb -> **run_callbacks**
310:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/callbacks.rb -> **_update_record**
70:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/timestamp.rb -> **_update_record**
504:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/persistence.rb -> **create_or_update**
302:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/callbacks.rb -> **block in create_or_update**
115:  [GEM_ROOT]/gems/activesupport-4.2.3/lib/active_support/callbacks.rb -> **call**
115:  [GEM_ROOT]/gems/activesupport-4.2.3/lib/active_support/callbacks.rb -> **call**
553:  [GEM_ROOT]/gems/activesupport-4.2.3/lib/active_support/callbacks.rb -> **block (2 levels) in compile**
503:  [GEM_ROOT]/gems/activesupport-4.2.3/lib/active_support/callbacks.rb -> **call**
503:  [GEM_ROOT]/gems/activesupport-4.2.3/lib/active_support/callbacks.rb -> **call**
88:  [GEM_ROOT]/gems/activesupport-4.2.3/lib/active_support/callbacks.rb -> **run_callbacks**
302:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/callbacks.rb -> **create_or_update**
120:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/persistence.rb -> **save**
37:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/validations.rb -> **save**
21:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/attribute_methods/dirty.rb -> **save**
286:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/transactions.rb -> **block (2 levels) in save**
351:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/transactions.rb -> **block in with_transaction_returning_status**
211:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb -> **transaction**
220:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/transactions.rb -> **transaction**
348:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/transactions.rb -> **with_transaction_returning_status**
286:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/transactions.rb -> **block in save**
301:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/transactions.rb -> **rollback_active_record_state!**
285:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/transactions.rb -> **save**
41:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/associations/has_many_association.rb -> **insert_record**
569:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/associations/collection_association.rb -> **block (2 levels) in concat_records**
408:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/associations/collection_association.rb -> **replace_on_target**
403:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/associations/collection_association.rb -> **add_to_target**
568:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/associations/collection_association.rb -> **block in concat_records**
566:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/associations/collection_association.rb -> **each**
566:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/associations/collection_association.rb -> **concat_records**
173:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/associations/has_many_association.rb -> **concat_records**
168:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/associations/collection_association.rb -> **block in concat**
183:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/associations/collection_association.rb -> **block in transaction**
211:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb -> **transaction**
220:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/transactions.rb -> **transaction**
182:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/associations/collection_association.rb -> **transaction**
168:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/associations/collection_association.rb -> **concat**
546:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/associations/collection_association.rb -> **replace_records**
373:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/associations/collection_association.rb -> **block in replace**
183:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/associations/collection_association.rb -> **block in transaction**
211:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb -> **transaction**
220:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/transactions.rb -> **transaction**
182:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/associations/collection_association.rb -> **transaction**
373:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/associations/collection_association.rb -> **replace**
47:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/associations/collection_association.rb -> **writer**
123:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/associations/builder/association.rb -> **active_users=**
88:  app/models/chat.rb -> **activate!**
188:  app/models/chat.rb -> **initialize_and_activate_for_friend!**
60:  app/models/chat.rb -> **block in activate_multiple!**
46:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/relation/delegation.rb -> **each**
46:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/relation/delegation.rb -> **each**
59:  app/models/chat.rb -> **activate_multiple!**
246:  app/models/message.rb -> **activate_chats!**
175:  app/models/message.rb -> **route_to_destination**
158:  app/models/message.rb -> **post_process!**
54:  [GEM_ROOT]/gems/aasm-4.2.0/lib/aasm/core/transition.rb -> **invoke_callbacks_compatible_with_guard**
32:  [GEM_ROOT]/gems/aasm-4.2.0/lib/aasm/core/transition.rb -> **execute**
115:  [GEM_ROOT]/gems/aasm-4.2.0/lib/aasm/core/event.rb -> **block in _fire**
107:  [GEM_ROOT]/gems/aasm-4.2.0/lib/aasm/core/event.rb -> **each**
107:  [GEM_ROOT]/gems/aasm-4.2.0/lib/aasm/core/event.rb -> **_fire**
26:  [GEM_ROOT]/gems/aasm-4.2.0/lib/aasm/core/event.rb -> **fire**
77:  [GEM_ROOT]/gems/aasm-4.2.0/lib/aasm/aasm.rb -> **aasm_fire_event**
175:  [GEM_ROOT]/gems/aasm-4.2.0/lib/aasm/persistence/active_record_persistence.rb -> **block in aasm_fire_event**
213:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb -> **block in transaction**
184:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/transaction.rb -> **within_new_transaction**
213:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb -> **transaction**
220:  [GEM_ROOT]/gems/activerecord-4.2.3/lib/active_record/transactions.rb -> **transaction**
175:  [GEM_ROOT]/gems/aasm-4.2.0/lib/aasm/persistence/active_record_persistence.rb -> **aasm_fire_event**
89:  [GEM_ROOT]/gems/aasm-4.2.0/lib/aasm/base.rb -> **block in event**
144:  app/models/message.rb -> **pre_process!**
16:  app/jobs/mo_message_received_job.rb -> **perform**
75:  [GEM_ROOT]/gems/sidekiq-3.4.2/lib/sidekiq/processor.rb -> **execute_job**
52:  [GEM_ROOT]/gems/sidekiq-3.4.2/lib/sidekiq/processor.rb -> **block (2 levels) in process**
127:  [GEM_ROOT]/gems/sidekiq-3.4.2/lib/sidekiq/middleware/chain.rb -> **block in invoke**
6:  [GEM_ROOT]/gems/sidekiq-3.4.2/lib/sidekiq/middleware/server/active_record.rb -> **call**
129:  [GEM_ROOT]/gems/sidekiq-3.4.2/lib/sidekiq/middleware/chain.rb -> **block in invoke**
74:  [GEM_ROOT]/gems/sidekiq-3.4.2/lib/sidekiq/middleware/server/retry_jobs.rb -> **call**
129:  [GEM_ROOT]/gems/sidekiq-3.4.2/lib/sidekiq/middleware/chain.rb -> **block in invoke**
15:  [GEM_ROOT]/gems/sidekiq-3.4.2/lib/sidekiq/middleware/server/logging.rb -> **block in call**
30:  [GEM_ROOT]/gems/sidekiq-3.4.2/lib/sidekiq/logging.rb -> **with_context**
11:  [GEM_ROOT]/gems/sidekiq-3.4.2/lib/sidekiq/middleware/server/logging.rb -> **call**
129:  [GEM_ROOT]/gems/sidekiq-3.4.2/lib/sidekiq/middleware/chain.rb -> **block in invoke**
132:  [GEM_ROOT]/gems/sidekiq-3.4.2/lib/sidekiq/middleware/chain.rb -> **call**
132:  [GEM_ROOT]/gems/sidekiq-3.4.2/lib/sidekiq/middleware/chain.rb -> **invoke**
51:  [GEM_ROOT]/gems/sidekiq-3.4.2/lib/sidekiq/processor.rb -> **block in process**
98:  [GEM_ROOT]/gems/sidekiq-3.4.2/lib/sidekiq/processor.rb -> **stats**
50:  [GEM_ROOT]/gems/sidekiq-3.4.2/lib/sidekiq/processor.rb -> **process**
26:  [GEM_ROOT]/gems/celluloid-0.16.1/lib/celluloid/calls.rb -> **public_send**
26:  [GEM_ROOT]/gems/celluloid-0.16.1/lib/celluloid/calls.rb -> **dispatch**
137:  [GEM_ROOT]/gems/celluloid-0.16.1/lib/celluloid/calls.rb -> **dispatch**
60:  [GEM_ROOT]/gems/celluloid-0.16.1/lib/celluloid/cell.rb -> **block in invoke**
71:  [GEM_ROOT]/gems/celluloid-0.16.1/lib/celluloid/cell.rb -> **block in task**
357:  [GEM_ROOT]/gems/celluloid-0.16.1/lib/celluloid/actor.rb -> **block in task**
57:  [GEM_ROOT]/gems/celluloid-0.16.1/lib/celluloid/tasks.rb -> **block in initialize**
14:  [GEM_ROOT]/gems/celluloid-0.16.1/lib/celluloid/tasks/task_fiber.rb -> **block in create**

Environment

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

No branches or pull requests

1 participant