Skip to content

fix(call): starting a call blocks the app for a second on a slow disk #491

Closed

Description

@GeiserX

Problem

On a slow disk, starting a call blocks the app for about a second. CallManager.start (src/main/call/manager.ts) runs its "folder" stage synchronously: it creates the call folder, takes the lock and writes call.created through the writer, which fsyncs. While that runs, the event loop gets no turn. Nothing else in the app can run: no HTTP request is answered, the window's requests stall, and a call that is still stopping cannot write.

We measured it on a fresh windows-latest runner while chasing the T0.16 CI flake (#490). The event loop got no timer turn for 1,071 ms after the start request. On a warm runner the same stage takes a few ms.

The stage is synchronous on purpose. No await between the live check and controllers.set means two starts can never both pass the "already recording" check.

What a fix needs

  • The one-live-call guarantee must hold: two concurrent starts give one call and one 409 already_recording (or one attached), never two folders or two helpers.
  • The event loop must stay free while the folder stage waits on the disk.
  • A failed folder stage must leave nothing live, so the next start isn't refused.
  • First, find out which part of the stage is slow on a cold Windows disk (mkdir, the lock link, opening the log, or the fsync), so the fix targets that part.

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