Skip to content

Conversation

@ntkathole
Copy link
Member

What this PR does / why we need it:

  • Implement HTTP connection pooling for the remote online store client to improve latency by reusing TCP/TLS connections across requests
  • Add configurable connection pool settings via feature_store.yaml: connection_pool_size, connection_idle_timeout, and connection_retries
  • Add automatic idle timeout to close stale sessions and release resources
  • Add thread-safe session management via HttpSessionManager class

Misc

New Features

  • Connection Pooling: HTTP sessions are now cached and reused, eliminating TCP/TLS handshake overhead (~40-130ms) on subsequent requests
  • Configurable Settings: Users can customize pool size, idle timeout, and retry behavior in feature_store.yaml
  • Automatic Idle Timeout: Sessions are automatically closed after configurable idle period (default: 5 minutes)
  • Retry with Backoff: Built-in exponential backoff retry logic for transient failures

Configuration Options

online_store:
  type: remote
  path: http://feast-feature-server:80
  connection_pool_size: 50        # Max connections in pool (default: 50)
  connection_idle_timeout: 300    # Idle timeout in seconds (default: 300, 0 to disable)
  connection_retries: 3           # Retry count with backoff (default: 3)

@ntkathole
Copy link
Member Author

FYI - @jyejare

@ntkathole ntkathole force-pushed the connection_pooling branch 2 times, most recently from 5878f9c to a672d43 Compare January 24, 2026 10:16
@ntkathole ntkathole self-assigned this Jan 24, 2026
@ntkathole ntkathole marked this pull request as ready for review January 24, 2026 10:16
@ntkathole ntkathole requested a review from a team as a code owner January 24, 2026 10:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements HTTP connection pooling for the remote online store client to improve performance by reusing TCP/TLS connections across requests. The changes introduce a thread-safe session manager, configurable connection pool settings, and automatic idle timeout management.

Changes:

  • Added HttpSessionManager class for thread-safe session caching and connection pooling
  • Added configurable connection pool settings: connection_pool_size, connection_idle_timeout, and connection_retries
  • Modified session management to use cached sessions instead of context managers
  • Added comprehensive test coverage for session management functionality

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
sdk/python/feast/permissions/client/http_auth_requests_wrapper.py Implements HttpSessionManager with connection pooling, retry logic, and idle timeout
sdk/python/feast/rest_error_handler.py Updates decorator to use cached sessions and extract connection pool config
sdk/python/feast/infra/online_stores/remote.py Adds connection pool config fields and close() method
sdk/python/tests/unit/permissions/auth/client/test_http_session_manager.py Adds comprehensive test suite for session manager
sdk/python/tests/unit/test_rest_error_decorator.py Updates tests to close cached sessions before running
docs/reference/online-stores/remote.md Documents connection pooling configuration and usage

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

{"Authorization": f"Bearer {auth_token}"}
)
except Exception as e:
logger.warning(f"Failed to refresh auth token: {e}")
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message 'Failed to refresh auth token' is logged but the exception is silently swallowed. This could lead to authentication failures being unnoticed. Consider either propagating the exception or providing more context about the consequences of continuing with a potentially stale token.

Suggested change
logger.warning(f"Failed to refresh auth token: {e}")
logger.warning(f"Failed to refresh auth token: {e}")
raise

Copilot uses AI. Check for mistakes.
Signed-off-by: ntkathole <nikhilkathole2683@gmail.com>
@franciscojavierarceo franciscojavierarceo merged commit e022bf8 into feast-dev:master Jan 26, 2026
24 of 25 checks passed
YassinNouh21 pushed a commit to YassinNouh21/feast that referenced this pull request Feb 7, 2026
…st-dev#5895)

Signed-off-by: ntkathole <nikhilkathole2683@gmail.com>
Signed-off-by: yassinnouh21 <yassinnouh21@gmail.com>
YassinNouh21 pushed a commit to YassinNouh21/feast that referenced this pull request Feb 7, 2026
…st-dev#5895)

Signed-off-by: ntkathole <nikhilkathole2683@gmail.com>
Signed-off-by: yassinnouh21 <yassinnouh21@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants