Streaming query continues probing database even with all users disconnected
TiagoJacobs opened this issue · comments
Version Information
Server Version:
hasura-graphql-engine version
Hasura GraphQL Engine: v2.37.0
Environment
OSS
cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.4 LTS"
What is the current behaviour?
Hasura continues sending streaming queries checks for postgresql even when all users are disconnected (I've ensured it using netstat
).
What is the expected behaviour?
After all users are disconnected, I expect that hasura stops probing postgresql.
How to reproduce the issue?
- Configure postgresql to log all the queries (
log_statement = 'all'
) - Launch 400 users in a BigBlueButton 3.0 server (which uses hasura)
- Wait for all users to leave.
- Stop bbb-graphql-middleware and nginx (to ensure nothing else is connected to hasura).
Screenshots or Screencast
In the screencast, I monitor the number of connections with port 8085 (which hasura is listening too).
When almost all users disconnected, I stop the nginx and the bbb-graphql-middleware (they route connections to hasura).
After stopping, I ensure there is no ESTABLISHED connection in port 8085.
Even after that, postgres continues receiving the streaming queries from probers.
PS: this doesn't happen with the subscription queries, only with streaming.
I kept the server running for 1 hour, and the queries were still being emmited, so it doesn't look like a pending timeout.
Link to the video (too long for github):
Keywords
always increasing system load, memory leak, cpu leak, streaming queries
Hello, this issue was fixed in version Hasura GraphQL Engine: v2.40.0