Disable Postgres leak tracing by default (#8712)

This commit is contained in:
2026-07-18 21:54:00 -07:00
committed by GitHub
parent 8a29847cc4
commit 027c5b6598
2 changed files with 10 additions and 3 deletions
@@ -53,7 +53,8 @@ case class PostgresConfig(
}
object PostgresConfig {
private[postgres] val DefaultMinimumIdle = 1
private[postgres] val DefaultMinimumIdle = 1
private[postgres] val DefaultLeakDetectionThresholdMillis = 0L
def fromEnvironment: Option[PostgresConfig] =
for
@@ -74,8 +75,10 @@ object PostgresConfig {
idleTimeoutMillis = PostgresConnectionProvider.envLong("EAGLE_POSTGRES_IDLE_TIMEOUT_MILLIS", 120000L),
maxLifetimeMillis = PostgresConnectionProvider.envLong("EAGLE_POSTGRES_MAX_LIFETIME_MILLIS", 1500000L),
keepaliveTimeMillis = PostgresConnectionProvider.envLong("EAGLE_POSTGRES_KEEPALIVE_TIME_MILLIS", 300000L),
leakDetectionThresholdMillis =
PostgresConnectionProvider.envLong("EAGLE_POSTGRES_LEAK_DETECTION_THRESHOLD_MILLIS", 60000L)
leakDetectionThresholdMillis = PostgresConnectionProvider.envLong(
"EAGLE_POSTGRES_LEAK_DETECTION_THRESHOLD_MILLIS",
DefaultLeakDetectionThresholdMillis
)
)
}
@@ -8,6 +8,10 @@ class PostgresConnectionProviderTest extends AnyFlatSpec with Matchers {
PostgresConfig.DefaultMinimumIdle shouldBe 1
}
it should "disable connection leak tracing by default" in {
PostgresConfig.DefaultLeakDetectionThresholdMillis shouldBe 0L
}
"PostgresConfig.jdbcUrl" should "enable PostgreSQL batched insert rewriting" in {
val config = PostgresConfig(
host = "postgres.example.com",