Skip to content

Transport close cancels the session's jobs instead of preserving durable work #54

@nficano

Description

@nficano

src/runtime/server.rs:551 tears down a connection by cancelling the connection token and then iterating jobs.list_for_session(&s.session_id, None) to call jobs.cancel for every job from that session. That makes a normal transport drop cancel in-flight work. The behavior contradicts the durable job and resume model described in README.md:105, README.md:117, docs/guides/resume.md:3, and docs/conformance.md:12, and it also makes a reconnect unable to resume a job because the original connection has already fired the cancellation token.

Fix prompt: Separate transport lifetime from job lifetime. On connection close, stop only the per-connection reader, writer, and subscription forwarder tasks, and keep job tasks running unless the client sent session.close or an explicit cancel that is authorized for the job. Add a regression test that starts a long-running tool, drops the transport without sending cancel, reconnects or observes via another authorized session, and verifies that the job reaches its natural terminal state instead of job.cancelled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingseverity:highHigh severity issue

    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