Skip to content

PostgreSQL Passwordless ignores socketTimeout connection paramΒ #47874

@lukaskirner

Description

@lukaskirner

Describe the bug
Setting socketTimeout=10 in the JDBC url by using passwordless has no effect

spring.datasource.url: jdbc:postgresql://${DB_HOST}:${DB_PORT}/${DB_NAME}?socketTimeout=10

Exception or Stack Trace
Exception java.lang.Exception: Apparent connection leak detected is thrown after the configured 15s. But there should be a SocketTimeoutException after 10s.

To Reproduce
Simpel Spring Starter with spring-data-jpa

Code Snippet

spring:
  cloud:
    azure:
      credential:
        managed-identity-enabled: true
        client-id: ${AZURE_CLIENT_ID}
  datasource:
    driver-class-name: org.postgresql.Driver
    url: jdbc:postgresql://${DB_HOST}:${DB_PORT}/${DB_NAME}?sslmode=require&socketTimeout=10
    username: ${DB_USERNAME}
    hikari:
      connection-timeout: 5000 #5s
      leak-detection-threshold: 15000 #15s
      maximum-pool-size: 5
      minimum-idle: 2
    azure:
      passwordless-enabled: true

Expected behavior
After 10s the SocketTimeoutException should be thrown. By removing the passwordless feature this is the case.

Setup (please complete the following information):

  • Library/Libraries: com.azure.spring:spring-cloud-azure-starter-jdbc-postgresql:6.1.0
  • Java version: 25
  • Frameworks: Spring Boot 3.5.10

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added

Metadata

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.azure-springAll azure-spring related issuescustomer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

Status

Need Feedback

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions