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

SQL registry disconnections #3611

Closed
jiewpeng opened this issue Apr 28, 2023 · 4 comments
Closed

SQL registry disconnections #3611

jiewpeng opened this issue Apr 28, 2023 · 4 comments
Labels
kind/bug priority/p2 wontfix This will not be worked on

Comments

@jiewpeng
Copy link

jiewpeng commented Apr 28, 2023

Expected Behavior

SQL registry works.

Current Behavior

When a SQL registry is used, there is a chance that we may hit a psycopg2.OperationalError: SSL connection has been closed unexpectedly issue. This can happen due to the connection being closed for being idle for too long.

Steps to reproduce

Use a SQL registry and set a connection idle timeout at the DB. Create a feature store object to connect to this registry, and wait for the timeout (i.e. don't query the feature store). Then try to query the feature store.

Specifications

  • Version: 0.25.0 (but should not matter)
  • Platform: Linux

Possible Solution

When creating the SQL registry, use self.engine = create_engine(..., pool_pre_ping=True). See https://docs.sqlalchemy.org/en/14/core/pooling.html#pool-disconnects

@stale
Copy link

stale bot commented Sep 17, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Sep 17, 2023
@tokoko
Copy link
Collaborator

tokoko commented Mar 21, 2024

@jeremyary looks like this was fixed and accidentally left open.

@blopezpi
Copy link

@jeremyary @tokoko We encountered the same issue with Feast version 0.35.0. It seems the issue was resolved for using PostgreSQL as the online store, but when utilizing PostgreSQL as a registry, we cannot configure a connection pool. Instead, we've adjusted the Keepalive idle parameters to a larger value or used a proxy like RDS Proxy or PgBouncer to mitigate this error. This error occurs only when using the Python API Feature Server, and we need to adjust these values or attempt a retry to retrieve the features. Could we open this issue again? Thank you.

@tokoko
Copy link
Collaborator

tokoko commented Apr 16, 2024

@blopezpi you're right, sorry about that. Have you tried the solution that's suggested in the issue? You can pass {'pool_pre_ping': True} as sqlalchemy_config_kwargs if you're using sql registry. Something like this if you're configuring from feature_store.yaml:

registry:
    registry_type: sql
    path: postgresql://postgres:mysecretpassword@127.0.0.1:55001/feast
    sqlalchemy_config_kwargs:
        pool_pre_ring: true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug priority/p2 wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

4 participants