finch
finch copied to clipboard
Add helpful checkout timeout error
fixes #125
Error before:
19:09:43.864 [error] GenServer #PID<0.831.0> terminating
** (stop) exited in: NimblePool.checkout(#PID<0.1615.0>)
** (EXIT) time out
(finch 0.6.3) lib/finch/http1/pool.ex:58: Finch.HTTP1.Pool.request/5
(finch 0.6.3) lib/finch.ex:247: Finch.request/3
(tesla 1.4.0) lib/tesla/adapter/finch.ex:63: Tesla.Adapter.Finch.call/2
(tesla 1.4.0) lib/tesla/middleware/json.ex:54: Tesla.Middleware.JSON.call/3
(httpperftest 0.1.0) lib/finch_client.ex:34: Httpperftest.FinchClient.users_get/0
After:
19:06:57.252 [error] GenServer #PID<0.1532.0> terminating
** (RuntimeError)
Timeout while waiting to checkout an http connection for process(es): [#PID<0.1615.0>].
Consider:
1. Increasing your poolsize (recommended).
2. Increasing your pool_timeout. Current timeout is: 3000.
(nimble_pool 0.2.4) lib/nimble_pool.ex:319: NimblePool.exit!/3
(finch 0.6.3) lib/finch/http1/pool.ex:39: Finch.HTTP1.Pool.request/5
(finch 0.6.3) lib/finch.ex:247: Finch.request/3
(tesla 1.4.0) lib/tesla/adapter/finch.ex:63: Tesla.Adapter.Finch.call/2
(tesla 1.4.0) lib/tesla/middleware/json.ex:54: Tesla.Middleware.JSON.call/3
(httpperftest 0.1.0) lib/finch_client.ex:34: Httpperftest.FinchClient.users_get/0
I'm also running mix format on the files I've changed, so that's the source of any unrelated changes.
We're debugging some nimble pool checkout issues and I found this PR, it was educational for me and might be a good addition to Finch!
Our team was looking into some nimble pool checkout issues as well today. 💯 % agree with @mattbaker - this PR was helpful. Given that this is over 1 year old, have any other changes been made to make errors in this area a bit more clear? If not, would it make sense to resolve the conflicts here and try to get this in?
Alright, I'm convinced! Glad that it has proven to be useful. I will clean things up and merge it soon.
Updated the PR with upstream so we can get this merged!
Thanks @SophisticaSean! 🙌🏽