Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Bug]: When using postgresql as database, high postgresql transaction rollback rate detected #1108

Open
Labels
bugSomething isn't working triageIssues / Features awaiting triage
Milestone
@xincheng-96

Description

🐞 Bug Summary

When using external postgresql as database, high postgresql transaction rollback rate detected (possibly due to health check). Even though the mcp-gateway has not been put in use (no mcp server registered, no client trying to connect)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)

🧩 Affected Component

Select the area of the project impacted:

  • mcpgateway - API
  • mcpgateway - UI (admin panel)
  • mcpgateway.wrapper - stdio wrapper
  • Federation or Transports
  • CLI, Makefiles, or shell scripts
  • Container setup (Docker/Podman/Compose)
  • Other (explain below)

🔁 Steps to Reproduce

  1. start the mcp-gateway with postgresql as database
  2. check postgresql logs
    2025年09月22日 04:16:03.259 PDT,"mcp_gateway_db_owner","mcp_gateway_db",3635047,"10.137.80.84:45972",68d12f8a.377767,31,"BEGIN",2025年09月22日 04:14:18 PDT,53/2396001,0,LOG,00000,"duration: 0.028 ms statement: BEGIN",,,,,,,,,"app - 10.36.67.18:24158","client backend",,6650430479887907887 2025年09月22日 04:16:03.260 PDT,"mcp_gateway_db_owner","mcp_gateway_db",3635047,"10.137.80.84:45972",68d12f8a.377767,32,"SELECT",2025年09月22日 04:14:18 PDT,53/2396001,0,LOG,00000,"duration: 0.037 ms statement: SELECT 1",,,,,,,,,"app - 10.36.67.18:24158","client backend",,6865378226349601843 2025年09月22日 04:16:03.261 PDT,"mcp_gateway_db_owner","mcp_gateway_db",3635047,"10.137.80.84:45972",68d12f8a.377767,33,"ROLLBACK",2025年09月22日 04:14:18 PDT,53/0,0,LOG,00000,"duration: 0.029 ms statement: ROLLBACK",,,,,,,,,"app - 10.36.67.18:24158","client backend",,3749380189022910195

🤔 Expected Behavior

no rollback transactions on postgresql during normal execution.
allow configuration of autocommit to true when using postgresql

📓 Logs / Error Output

as above


🧠 Environment Info

You can retrieve most of this from the /version endpoint.

Key Value
Version or commit v0.6.0 and v0.7.0
Runtime python 3.11.11
Platform / OS Ubuntu 16.2-1.pgdg22.04+1
Container kubernetes

🧩 Additional Context (optional)

Autocommit=False hard coded in db.py https://github.com/IBM/mcp-context-forge/blob/v0.7.0/mcpgateway/db.py#L150

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working triageIssues / Features awaiting triage

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      AltStyle によって変換されたページ (->オリジナル) /