Skip to content

CodSpeed runner hangs when using divan's threads feature #186

Description

@MichaReiser

Salsa's parallel benchmarks are extremely noisy. I hoped to reduce the noise by using divan's threads feature (salsa-rs/salsa#1272). Unfortunately, CodSpeed hangs.

Codex analysis:

Yes. I reproduced a real race condition in CodSpeed’s Divan integration:

  1. Every Divan worker calls add_benchmark_timestamps concurrently. Source
  2. CodSpeed declares its shared instrumentation handle Sync without synchronization. Source
  3. Workers consequently mutate the same FIFO buffer and write message headers and bodies separately, corrupting the protocol. Source

Using a local mock CodSpeed runner:

1 worker: completed successfully
4 workers: Corrupt command tag: 20 → hangs

CodSpeed needs either synchronized access to its instrumentation handle or instrumentation emitted by only one worker.

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