Skip to content

SS-1930 Add automatic cleanup for idle Postgres sessions#542

Merged
hamzaimran08 merged 4 commits into
developfrom
SS-1930-add-removal-of-idle-connections
Jun 9, 2026
Merged

SS-1930 Add automatic cleanup for idle Postgres sessions#542
hamzaimran08 merged 4 commits into
developfrom
SS-1930-add-removal-of-idle-connections

Conversation

@hamzaimran08

Copy link
Copy Markdown
Collaborator

Description

This PR relates to SS-1930.

Adds PostgreSQL session timeout configuration for Studio database connections so idle sessions are cleaned up automatically. The defaults are:

  • POSTGRES_IDLE_SESSION_TIMEOUT=30m
  • POSTGRES_IDLE_IN_TRANSACTION_SESSION_TIMEOUT=10m

The Django database configuration now passes these values through PostgreSQL connection options and enables CONN_HEALTH_CHECKS, so pooled connections are checked before reuse if PostgreSQL has closed an idle connection. The new environment variables are also documented in .env.template.

Checklist

  • This pull request is against develop branch (not applicable for hotfixes)
  • I have included a link to the issue on GitHub or JIRA (if any)
  • I have included migration files (if there are changes to the model classes)
  • I have added or updated unit and end2end tests or a manual test case to complement my changes
  • I have ran unit and end2end tests
  • I have updated the related documentation (if necessary)
  • I have added a reviewer for this pull request
  • I have added myself as an author for this pull request
  • In the case I have modified settings.py, then I have also updated the studio-settings-configmap.yaml file in serve-charts
  • In case your changes are large enough, did you deploy your changes to develop instance?

@hamzaimran08 hamzaimran08 requested a review from a team as a code owner June 5, 2026 13:29
@hamzaimran08 hamzaimran08 self-assigned this Jun 5, 2026
@hamzaimran08 hamzaimran08 requested a review from j-awada June 5, 2026 13:29

@j-awada j-awada left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Works as expected locally and LGTM.

@hamzaimran08 hamzaimran08 merged commit 8cc2da5 into develop Jun 9, 2026
2 checks passed
@hamzaimran08 hamzaimran08 deleted the SS-1930-add-removal-of-idle-connections branch June 9, 2026 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants