Hey @flamber!
Thanks for providing some guidance back in March.
I managed to fix this today.
For anyone who happens to land here:
Context
My infra was setup like this:
Client -> Haproxy -> EC2 Instance running Metabase Docker
TL:DR
Issue: Haproxy (proxy/load balancer) setting
I had the following setting in Haproxy:
frontend web-http
bind *:80
# ...
option http-server-close
Offending line was option http-server-close
Changed it to option http-keep-alive
and managed to have correct number of rows returned for my queries.
Longer Story
From reading metabase logs, I saw that I was getting ClosedChannelException
This indicated to me that it's a network issue.
After coming across the following links:
- "Error determining whether HTTP request was canceled" with long-running postgres queries · Issue #12335 · metabase/metabase · GitHub
- Continuous errors until complete query execution - #4 by flamber
- https://www.metabase.com/docs/latest/operations-guide/log-configuration.html
I figured it was a network issue, and not a metabase issue.
- Check the metabase webserver (jetty) error logs
- Cross reference the errors reported and how you setup your infra
If you face the same issue, it could be a network setting in your infra because metabase uses a buffer to send the data to your client.