DBConnection.ConnectionError when number of favourites is less than limit
I have an account that favourited 1 status. When I try to get the favourites with /api/v1/favourites?limit=1
or without limit, the call succeeds and takes about 1 second. If I specify a higher limit, the call takes around 15 seconds and fails most of the time with HTTP code 500 and returns {"errors":{"detail":"Internal server error"}}
. The log shows a DBConnection.ConnectionError
.
[error] #PID<0.1639.0> running Pleroma.Web.Endpoint (connection #PID<0.1638.0>, stream id 1) terminated_Server: likeable.space:80 (http)_Request: GET /api/v1/favourites?limit=5_** (exit) an exception was raised:_ ** (DBConnection.ConnectionError) tcp recv: closed (the connection was closed by the pool, possibly due to a timeout or because the pool has been terminated)_ (ecto_sql) lib/ecto/adapters/sql.ex:624: Ecto.Adapters.SQL.raise_sql_call_error/1_ (ecto_sql) lib/ecto/adapters/sql.ex:557: Ecto.Adapters.SQL.execute/5_ (ecto) lib/ecto/repo/queryable.ex:147: Ecto.Repo.Queryable.execute/4_ (ecto) lib/ecto/repo/queryable.ex:18: Ecto.Repo.Queryable.all/3_ (pleroma) lib/pleroma/pagination.ex:18: Pleroma.Pagination.fetch_paginated/2_ (pleroma) lib/pleroma/web/activity_pub/activity_pub.ex:797: Pleroma.Web.ActivityPub.ActivityPub.fetch_activities/2_ (pleroma) lib/pleroma/web/mastodon_api/mastodon_api_controller.ex:1090: Pleroma.Web.MastodonAPI.MastodonAPIController.favourites/2_ (pleroma) lib/pleroma/web/mastodon_api/mastodon_api_controller.ex:5: Pleroma.Web.MastodonAPI.MastodonAPIController.action/2
I'm on commit eba3db09