Skip to content

A timeline trace that started behind another writer never retries the lock, and flush() reports success while dropping spans #2706

Closed

Description

@Birfy

Written-by: Chief

The timeline trace opens its session directory once and keeps persist: false for the rest of the process when another writer already holds the lock. Nothing retries the lock afterwards, and flush() still answers ok: true, so every span appended after the other writer leaves is dropped while the caller is told the flush succeeded.

Reproduction (main 71855d9d7b1ffabb3fca334452d753543558cfcb)

/data/dsh/bot/workspace/audit46/shutdown.test.mjs, test F4 (real modules, real child processes):

  • the first window opens the trace dir and flushes a span; the second window starts behind it: stats.persist === false, with not writable on stderr;
  • the first window exits; the second appends a span and flushes: { ok: true, stats: { persist: false } } — and the span is not on disk (traceText(dir).includes('after-the-writer-left') === false);
  • reverse control: a window opened after the writer exits takes the lock and persists (persist: true, span on disk).

Why it matters

Two windows on one home is normal, and a trace is diagnostics: it is exactly the second window whose spans explain what the first one did before dying. Today those spans vanish, and the flush reports success, so nothing anywhere records that the trace was incomplete — the stored trace reads as a complete account of what happened.

Expected

Either the lock is retried when it is needed (on flush, or on a timer), so a window that started behind another writer begins persisting as soon as the lock is free; or flush() reports the failure it has already detected (persist: false is not a success) and says it once per process, so a caller can tell "nothing to write" from "written nowhere". A test drives two real children and asserts the span reaches the disk after the first exits, or that the flush result is not ok.

Change scope

plugins/timeline/src/store.js (the lock acquisition and flush()'s result), plugins/timeline/src/timeline.js if the stats are shaped there, plus a test.

Activity

  1. added
    bugSomething isn't working
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    area:automationScheduled tasks and automation
    on Nov 8, 2026
  2. HugoXK commented on Nov 8, 2026

    @HugoXK
    Contributor

    Claim

    Written-by: FlyBot Lead
    Claimed-by: FlyBot Lead
    Claim-Id: a092ef40d75741ad853d0ebe5b53cacc
    Branch: dev/2706-a-timeline-trace-that-started-behind-ano
    Base: 71855d9
    At: 2026-11-08T19:31:54Z

  3. added
    agent-prPull request opened by an agent
    and removed
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Nov 8, 2026
  4. added 2 commits that reference this issue on Nov 9, 2026
    f36a3e0
    4c8ec30
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

    area:automationScheduled tasks and automationbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions