Cinder.Table count timeout not working as expected
Hey @sevenseacat i saw that there was a new version with fixes for the timeout and this issue was closed (https://github.com/sevenseacat/cinder/issues/7)
But i'm still getting the same error even when setting the
query_opts={[timeout: :timer.seconds(20)]}
Idk how exactly the count is handled in Cinder but in Ash there is a way to automatically ask for count? Im trying to understand how it reaches the function in the stack trace, there is a Task.await
without opts so that is where the timeout 5000 is coming from, these defaults https://hexdocs.pm/elixir/Task.html#await/211 Replies
if Ash isn't respecting the timeout option we pass in, that's not good 🤔 Cinder provides pagination options when building the query, and Ash handles the rest https://github.com/sevenseacat/cinder/blob/main/lib/cinder/query_builder.ex#L83-L96
I can see the Task.await but also not sure where the task is coming from
ok found it, and the opts should be getting passed through 🤔
then the behaviour is def weird 🤔
digging into it
Looks like a missing
:infinity
to me 🙂wouldnt it be better to inherit the query_opts timeout or the ash config one? otherwise if there is an issue with the DB that connection would get stuck
this is only used for the count query, no other query
though tbh a count query shouldnt be taking 5 seconds 🙈
Yes it should timeout similarly to the parent query
Solution
I can fix that
I had no idea it was taking that long either, its just a users_status_history table
just did an analyze and it took 13seconds 🙈
yeah that's weird
I did not know of this package!!
Thanks for asking questoin 🥳