altimate-code icon indicating copy to clipboard operation
altimate-code copied to clipboard

fix: CI failure — concurrent trace file writes produce corrupted JSON

Open anandgupta42 opened this issue 8 months ago • 0 comments

Description

The test Concurrent sessions > concurrent traces to same session ID overwrite cleanly is failing on main with:

SyntaxError: JSON Parse error: Unterminated string

Root cause: FileExporter.export() uses fs.writeFile() (non-atomic), while the snapshot() method uses atomic writes (tmp + rename). When concurrent sessions write to the same trace file, a snapshot rename can race with a non-atomic writeFile, producing truncated JSON.

CI run: https://github.com/AltimateAI/altimate-code/actions/runs/23985613053/job/69956978499

anandgupta42 avatar Apr 04 '26 19:04 anandgupta42