Skip to content

Compositor editor rolls back a take the server applied when the reply takes over 3 s #918

Open

Description

@wagenet

Filed by Claude (AI) on behalf of @wagenet.

The compositor editor reports a take as failed and rolls back its Program/Preview swap when the server replies after more than 3 s. That rollback also happens when the server did apply the take, which leaves the editor showing the old pair while the new source is on air.

The 3 s limit is TRANSITION_TIMEOUT on ApiClient::trigger_transition, added in #807 so a take with no answer rolls back instead of hanging. The client cannot tell "no answer" from "late answer".

AppState::trigger_transition applies the take first. Only after that does it await self.inner.flows.write() to persist the alphas, and it replies after that. If that lock is held for more than 3 s, the take is on air and the client times out.

A scratch test reproduces the client side: a stub server that answers 200 after 3.5 s. With it, trigger_transition returns Network(...) after about 3.0 s. I have not seen the lock held that long on a real system. The ordering comes from reading the code; it was not measured on a rig.

A second case, also unverified: the take request is queued behind pipelines.read() for more than 3 s. The client rolls back, and the take may still be applied later.

#916 adds transition_times_out_as_a_network_error, which pins today's behaviour: a take that gets no answer fails on the timeout. A fix for this issue will need to change that test on purpose.

Possible directions, not evaluated:

  • the server replies before persisting;
  • the editor reconciles from the StromEvent broadcast instead of the HTTP reply.

Activity

  1. srperens commented on Oct 19, 2026

    @srperens
    Collaborator

    Area: Compositor editor, take requests and server reply timing

    About: The editor rolls back its Program/Preview swap on any error, including its 3 s request timeout, but the server puts the take on air before it persists alphas under the flows write lock and replies. A slow reply therefore looks like a failed take while the new source is on air. A take queued behind the pipelines lock can also time out and still be applied later. Neither has been seen on a rig.

    Relates to: #807 (added the timeout), merged #916 (pins today's timeout behaviour in a test that a fix will change on purpose), #806 (open; makes TransitionTriggered report the pair that actually went to air and edits the same handler).

    Thoughts: Replying before persisting covers only the lock case. Settling the editor from the TransitionTriggered event, which the frontend does not consume yet, covers both, and is easiest after #806 lands.

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions