https://github.com/civilcode/db-proxy-issue
Demonstrates issue with DB Proxy posted to ElixirForum
https://github.com/civilcode/db-proxy-issue
Last synced: about 1 month ago
JSON representation
Demonstrates issue with DB Proxy posted to ElixirForum
- Host: GitHub
- URL: https://github.com/civilcode/db-proxy-issue
- Owner: civilcode
- Created: 2017-03-31T19:55:28.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-31T21:42:08.000Z (about 9 years ago)
- Last Synced: 2025-03-21T17:54:34.301Z (over 1 year ago)
- Language: Elixir
- Homepage: https://elixirforum.com/t/issue-with-dbconnection-ownership-proxy-checkout-and-genserver-process/4334
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DbProxyIssue
Application with one GenServer doing calls to the database in synchronous mode.
See post on [ElixirForum](https://elixirforum.com/t/issue-with-dbconnection-ownership-proxy-checkout-and-genserver-process/4334).
## Installation
mix deps.get
MIX_ENV=test ecto.create # you may wish to update config/test.ex with your database config
## How to reproduce the issue
Run:
while true; do mix test; done
Eventually, a `GenServer` error will occur. Example:
```
12:25:35.584 [error] GenServer DbProxyIssue.Worker terminating
** (stop) exited in: GenServer.call(#PID<0.197.0>, {:checkout, #Reference<0.0.2.1622>, true, 15000}, 5000)
** (EXIT) shutdown: "owner #PID<0.196.0> exited with: shutdown"
(db_connection) lib/db_connection/ownership/proxy.ex:32: DBConnection.Ownership.Proxy.checkout/2
```
Work-arounds:
- Set the `pool_size` to `1` in `config/test.exs`
- Sleep 100ms before running the test (`:timer.sleep(100)` in `test/support/test_case.ex`)