Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection leak happening in supavisor connections #595

Closed
LakhveerChahal opened this issue Feb 9, 2025 · 7 comments
Closed

Connection leak happening in supavisor connections #595

LakhveerChahal opened this issue Feb 9, 2025 · 7 comments
Labels
bug Something isn't working

Comments

@LakhveerChahal
Copy link

LakhveerChahal commented Feb 9, 2025

Bug report

  • [N] I confirm this is a bug with Supabase, not with my own application.
    I'm not aware of the exact RCA, hence can't tell. I've tried SingleConnectionDataSource & PGSimpleDataSource in JDBC, but the issue still persists.
  • [Y] I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

When connecting to Supavisor in Transaction pooler mode via JDBC (SingleConnectionDataSource or PGSimpleDataSource), the supavisor connections are not being released after calling connection.close(). I kept the suppressClose to false to avoid any connection proxy. After a while, the supavisor connections in grafana reaches to 200 count and application starts throwing below exception:
FATAL: Max client connections reached

On top of this, even if the application server is stopped, the supavisor connection count still remains the same. So, even if there was possibility of having bug in my application code, the connection count should ideally drop to zero when the server is killed.

Expected behavior

Supavisor connection should get released when connection is closed by application code.

Screenshots

Image

System information

  • OS: Linux (Although not applicable)
  • Browser (if applies) Not Applicable
  • Version of supabase-js: hosted on supabase
  • Version of Node.js: Not being used
  • Version of Java: 17

Additional context

References:
SingleConnectionDataSource - https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/jdbc/datasource/SingleConnectionDataSource.html
PGSimpleDataSource- https://jdbc.postgresql.org/documentation/publicapi/org/postgresql/ds/PGSimpleDataSource.html

@LakhveerChahal LakhveerChahal added the bug Something isn't working label Feb 9, 2025
Copy link

linear bot commented Feb 9, 2025

Copy link
Member

hauleth commented Feb 10, 2025

Is it self hosted Supavisor instance? If so, which version of Supavisor do you run?

@LakhveerChahal
Copy link
Author

LakhveerChahal commented Feb 10, 2025

No, it is not self hosted. Using the Supabase hosted Supavisor only.

@hauleth
Copy link
Member

hauleth commented Feb 10, 2025

@LakhveerChahal have you reported that to the Supabase Helpdesk? That would help us as it would provide us the information about your project so we would be able to access the logs and metrics for your organisation.

@jayeshgk95
Copy link

Hi @hauleth
We have added a support ticket with the following ID: 20158080681

@jayeshgk95
Copy link

@hauleth Do we have any update on this issue?
We are facing this issue on Project Id: xylvebryvatsekgukvlr

Adding a Screenshot of the "Number of Client Connections VS Time" graph for your reference.

Image

@hauleth
Copy link
Member

hauleth commented Feb 14, 2025

I have restarted your pool, so it should be now possible to reconnect. I will investigate it further, but I will move conversation to the support ticket.

@hauleth hauleth closed this as completed Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants