Skip to content

SQLite plugin: respect config.SQL.MaxConns instead of hardcoding SetMaxOpenConns(1) #9686

@PatschD

Description

@PatschD

Expected Behavior

The SQLite plugin should respect config.SQL.MaxConns and config.SQL.MaxIdleConns, consistent with the
MySQL and PostgreSQL plugins. When WAL mode is enabled via ConnectAttributes, users should be able to
configure multiple connections for improved throughput.

Actual Behavior

The SQLite plugin hardcodes db.SetMaxOpenConns(1) and db.SetMaxIdleConns(1), ignoring the config
fields. All Temporal services (frontend, history, matching, worker) serialize through a single
connection. At ~1000 concurrent workflows, internal operations (queue processor polls, session
heartbeats, workflow creation) exceed the 5-second ShardIOTimeout and fail with context deadline
exceeded.

Steps to Reproduce the Problem

  1. Start an embedded Temporal server with SQLite persistence (file mode, WAL enabled via
    ConnectAttributes)
  2. Set config.SQL.MaxConns = 4 in the persistence config
  3. Submit 1000+ workflows that use sessions (MaxConcurrentSessionExecutionSize: 50)
  4. Observe context deadline exceeded errors as operations queue behind the single connection. The
    MaxConns config value is silently ignored.

##Specifications

  • Version: v1.30.0 (also confirmed unchanged in v1.30.2)
  • Platform: All (SQLite plugin code is platform-independent)

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions