Skip to content

Conversation

@alxtkr77
Copy link
Member

@alxtkr77 alxtkr77 commented Jan 7, 2026

Summary

  • Add new config option model_endpoint_monitoring.tsdb.connection_pool_timeout to control TimescaleDB connection pool timeout
  • Default is 120 seconds (previously hardcoded to 30 seconds)
  • This allows API requests to wait longer for a database connection under high load

Changes Made

  • Added connection_pool_timeout config in mlrun/config.py under model_endpoint_monitoring.tsdb
  • Updated TimescaleDBConnection.pool property to use the configurable timeout
  • Added unit tests to verify the config is correctly applied


def test_pool_uses_configured_timeout(self):
"""Test that ConnectionPool is created with timeout from config."""
import mlrun.config
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should be fine to import at the top?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Or maybe not, because of the patching?

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right - moved the import to the top. The patching is for ConnectionPool, not for the config module, so it doesn't interfere.

…ut (ML-11775)

Add a new config option `model_endpoint_monitoring.tsdb.connection_pool_timeout`
to control the TimescaleDB connection pool timeout. Default is 120 seconds
(previously hardcoded to 30 seconds).

This allows API requests to wait longer for a database connection from the pool
under high load, instead of timing out prematurely at 30 seconds.
@gtopper gtopper merged commit a8c1684 into mlrun:development Jan 8, 2026
13 checks passed
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