Skip to content

manager socket: two response-ordering deviations from the protocol #13

Description

@kp2pml30

Found by a review pass over feat/rework-manager-api. Both are in implementation/src/manager/socket.rs, which is owned elsewhere — filing rather than patching.

1. run does semantic validation and module locking before allocating an ID

socket.rs:481, :491, :504.

The protocol (docs/website/src/impl-spec/appendix/manager-socket.rst:131) says the genvm_id is returned immediately and that request validation, permit acquisition and spawning complete asynchronously, with failures arriving as a terminal event.

In practice a request with non-empty host_hello_data[1], or one needing modules while modules are stopped, gets a direct error with no genvm_id and no terminal event. Module-lock acquisition can also delay the response.

Binary decode necessarily precedes ID allocation. But the semantic rejection classes should either move into supervision, or be documented as synchronous exceptions.

2. attach can enqueue a terminal notification before its own response

socket.rs:558, :582.

If a run finishes between taking the attach snapshot and sending the response, subscribe() spawns the forwarder before the response is queued; on a multithreaded runtime the forwarder can win and enqueue the terminal event first. The in-tree client expects the attach reply to be the next frame (tests/system/manager-socket/test.py:336) and fails.

Scheduler-dependent, but reachable. The run handler already does this correctly: retain the created receiver, enqueue the response, then start forwarding.

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