finch icon indicating copy to clipboard operation
finch copied to clipboard

Add helpful checkout timeout error

Open SophisticaSean opened this issue 4 years ago • 4 comments

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

SophisticaSean avatar Feb 27 '21 01:02 SophisticaSean

I'm also running mix format on the files I've changed, so that's the source of any unrelated changes.

SophisticaSean avatar Feb 27 '21 01:02 SophisticaSean

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!

mattbaker avatar Jan 21 '22 19:01 mattbaker

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?

daveshah avatar Oct 17 '22 17:10 daveshah

Alright, I'm convinced! Glad that it has proven to be useful. I will clean things up and merge it soon.

sneako avatar Oct 18 '22 08:10 sneako

Updated the PR with upstream so we can get this merged!

SophisticaSean avatar Oct 26 '22 10:10 SophisticaSean

Thanks @SophisticaSean! 🙌🏽

daveshah avatar Oct 27 '22 19:10 daveshah