Skip to content

Session store monolithic JSON with global lock causes cross-session contention #42160

@Diaspar4u

Description

@Diaspar4u

The session store uses a single sessions.json file with a global write lock. When one session writes (e.g., an agent doing many tool calls), all other sessions block waiting for the lock. This causes sessions_send timeouts and cross-topic blocking in multi-agent and high-traffic setups.

Previously reported in #5092 and #15507 (both closed). The underlying architecture issue remains: all session metadata funnels through a single file and a single lock, so write-heavy sessions starve readers and other writers.

A directory-per-session layout where each session key gets its own file would eliminate the global lock and allow atomic per-session writes via temp-file + rename.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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