Skip to content

Ensure unassigned workspace slots release when dispatch cleanup fails #170

Description

@danny-avila

Problem

In the concurrent dispatch finally path added by #167, cleanupDispatch(...) runs before workspaceSlots.release(...) when no assignment was stored. If cancellation or lock cleanup throws, control exits the finally block before the slot release. The reservation and workspace root then remain busy until TTL expiry instead of being released immediately.

Location

service/src/bridge/store.ts, the uncommitted dispatch cleanup and unassigned slot release around lines 1061–1074.

Expected behavior

Attempt slot release even when dispatch cleanup fails, while preserving the correct primary cleanup error. Add a regression test where cleanup throws after a concurrent reservation succeeds but before assignment storage.

Reported while syncing #167 into ClickHouse/ai; Bugbot discussion: https://github.com/ClickHouse/ai/pull/3674#discussion_r3964747711

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions