Add Repo name to timeout errors
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 55/100
Research direction
Start with PR 332 and the supplied DbConnectionErrorTest reproduction. Run the two ExUnit cases to compare timeout and ownership errors, then document the difference and the missing Repo name without assuming a timeout implementation change. Done means the reproduction and observed behavior are recorded clearly.
Written by the indexing model from the issue text.
Description
In https://github.com/elixir-ecto/db_connection/pull/332 we added the Repo's name (via a label) to ownership errors.
We didn't add it to timeout errors yet because it's more complex, but José expressed interest in doing it later - see comment thread.
For this issue, I just want to document the difference with a simple reproduction:
defmodule DbConnectionErrorTest do
use ExUnit.Case
alias MyApp.Repo
test "Unhandled case: trigger timeout error" do
Ecto.Adapters.SQL.Sandbox.checkout(Repo, ownership_timeout: 100)
Repo.transact(fn ->
Repo.query!("CREATE TEMP TABLE dogs (name text) ON COMMIT DROP")
# Hold the connection longer than the ownership_timeout above.
Process.sleep(200)
# Raises an exception that does not include the repo name
Repo.insert_all("dogs", [%{name: "Barkley"}])
{:ok, :ok}
end)
end
test "Handled case: trigger ownership error" do
# Raises an exception that includes the Repo name (as of PR 332)
spawn(fn ->
Process.sleep(1_000)
Repo.query!("SELECT 1")
end)
on_exit(fn -> Process.sleep(1500) end)
end
end
- Dominant language
- Elixir
- Stars
- 355
- Forks
- 122
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from elixir-ecto/db_connection
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
elixir-ecto/db_connection#299 · 2 comments ·
All issues in elixir-ecto/db_connection
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
phoenixframework/phoenix#6847 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
beyond-all-reason/teiserver#1584 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ash-project/ash#2954 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
membraneframework/boombox#149 ·