Skip to content

Instantly share code, notes, and snippets.

@tony612
Created April 21, 2016 14:15
Show Gist options
  • Select an option

  • Save tony612/88ada2da7f18ca36185d214013fc4640 to your computer and use it in GitHub Desktop.

Select an option

Save tony612/88ada2da7f18ca36185d214013fc4640 to your computer and use it in GitHub Desktop.
ecto deadlock
............................
1) test messages_count_after/2 returns messages count after the time (Exchat.ChannelRepoTest)
test/models/channel_repo_test.exs:39
** (Postgrex.Error) ERROR (deadlock_detected): deadlock detected
Process 46899 waits for ShareLock on transaction 8436; blocked by process 46892.
Process 46892 waits for ShareLock on transaction 8431; blocked by process 46899.
stacktrace:
(ecto) lib/ecto/adapters/sql.ex:405: Ecto.Adapters.SQL.struct/6
(ecto) lib/ecto/repo/schema.ex:373: Ecto.Repo.Schema.apply/5
(ecto) lib/ecto/repo/schema.ex:179: anonymous fn/11 in Ecto.Repo.Schema.do_insert/4
(ecto) lib/ecto/repo/schema.ex:581: anonymous fn/3 in Ecto.Repo.Schema.wrap_in_transaction/6
(ecto) lib/ecto/adapters/sql.ex:450: anonymous fn/3 in Ecto.Adapters.SQL.do_transaction/3
(db_connection) lib/db_connection.ex:1079: DBConnection.transaction_run/4
(db_connection) lib/db_connection.ex:1009: DBConnection.run_begin/3
(db_connection) lib/db_connection.ex:766: DBConnection.transaction/3
(ecto) lib/ecto/repo/schema.ex:112: Ecto.Repo.Schema.insert!/4
test/models/channel_repo_test.exs:41
..............
Finished in 1.8 seconds (0.5s on load, 1.3s on tests)
43 tests, 1 failure
Randomized with seed 692450
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment