Skip to content

Conversation

@Sayan-
Copy link
Contributor

@Sayan- Sayan- commented Dec 5, 2025

Overview

Noticed some issues with our replay stop + download flow. Adding a script to help with testing scenarios / repeatability.

I ran the docker container locally and then hit it directly. Even on local we can reasonably repro the failures

Testing

Ran locally and confirmed we can detect the failures. Example run:

Testing concurrent stop race condition
  URL: http://localhost:444
  Duration: 3s
  Concurrency: 2
  Iterations: 5

=== Iteration 1/5 (id=race-test-1764972766315168000-0) ===
  Starting recording...
  Recording for 3 seconds...
  Calling stop 2 times concurrently...
  Downloading recording...
  Downloaded 36 bytes
  Validating with ffprobe...
❌ FAILED: validation failed: ffprobe failed: exit status 1
Output: [mov,mp4,m4a,3gp,3g2,mj2 @ 0x11f606420] moov atom not found
/var/folders/km/8rkz_b8s4dj0djvhk0p82bm80000gn/T/race-test-812359799.mp4: Invalid data found when processing input
{

}


=== Iteration 2/5 (id=race-test-1764972770128817000-1) ===
  Starting recording...
  Recording for 3 seconds...
  Calling stop 2 times concurrently...
  Downloading recording...
  Downloaded 36 bytes
  Validating with ffprobe...
❌ FAILED: validation failed: ffprobe failed: exit status 1
Output: [mov,mp4,m4a,3gp,3g2,mj2 @ 0x150804820] moov atom not found
/var/folders/km/8rkz_b8s4dj0djvhk0p82bm80000gn/T/race-test-877575510.mp4: Invalid data found when processing input
{

}


=== Iteration 3/5 (id=race-test-1764972773977277000-2) ===
  Starting recording...
  Recording for 3 seconds...
  Calling stop 2 times concurrently...
  Downloading recording...
  Downloaded 20968 bytes
  Validating with ffprobe...
  Video duration: 3.600000 seconds
  Cleaning up...
✅ PASSED

=== Iteration 4/5 (id=race-test-1764972777850324000-3) ===
  Starting recording...
  Recording for 3 seconds...
  Calling stop 2 times concurrently...
  Downloading recording...
  Downloaded 21007 bytes
  Validating with ffprobe...
  Video duration: 3.600000 seconds
  Cleaning up...
✅ PASSED

=== Iteration 5/5 (id=race-test-1764972781717936000-4) ===
  Starting recording...
  Recording for 3 seconds...
  Calling stop 2 times concurrently...
  Downloading recording...
  Downloaded 20978 bytes
  Validating with ffprobe...
  Video duration: 3.600000 seconds
  Cleaning up...
✅ PASSED

=== RESULTS: 3 passed, 2 failed ===

Note

Introduce a Go script to test concurrent recording stop behavior, add retry dependency, and ignore local recordings.

  • Scripts/Tooling:
    • Add server/scripts/concurrent_stop_test/main.go to reproduce and validate concurrent recording stop behavior (start, concurrent stop calls, retrying download, ffprobe validation, cleanup; configurable via flags).
  • Dependencies:
    • Add github.com/avast/retry-go/v5 (updated go.mod/go.sum).
  • Repo:
    • Ignore recordings/ in .gitignore.

Written by Cursor Bugbot for commit 7808c6c. This will update automatically on new commits. Configure here.

@mesa-dot-dev
Copy link

mesa-dot-dev bot commented Dec 5, 2025

You do not have enough credits to review this pull request. Please purchase more credits to continue.

@Sayan- Sayan- requested a review from hiroTamada December 5, 2025 22:18
@mesa-dot-dev
Copy link

mesa-dot-dev bot commented Dec 5, 2025

Mesa Description

Overview

Noticed some issues with our replay stop + download flow. Adding a script to help with testing scenarios / repeatability.

I ran the docker container locally and then hit it directly. Even on local we can reasonably repro the failures

Testing

Ran locally and confirmed we can detect the failures. Example run:

Testing concurrent stop race condition
  URL: http://localhost:444
  Duration: 3s
  Concurrency: 2
  Iterations: 5

=== Iteration 1/5 (id=race-test-1764972766315168000-0) ===
  Starting recording...
  Recording for 3 seconds...
  Calling stop 2 times concurrently...
  Downloading recording...
  Downloaded 36 bytes
  Validating with ffprobe...
❌ FAILED: validation failed: ffprobe failed: exit status 1
Output: [mov,mp4,m4a,3gp,3g2,mj2 @ 0x11f606420] moov atom not found
/var/folders/km/8rkz_b8s4dj0djvhk0p82bm80000gn/T/race-test-812359799.mp4: Invalid data found when processing input
{

}

=== Iteration 2/5 (id=race-test-1764972770128817000-1) ===
  Starting recording...
  Recording for 3 seconds...
  Calling stop 2 times concurrently...
  Downloading recording...
  Downloaded 36 bytes
  Validating with ffprobe...
❌ FAILED: validation failed: ffprobe failed: exit status 1
Output: [mov,mp4,m4a,3gp,3g2,mj2 @ 0x150804820] moov atom not found
/var/folders/km/8rkz_b8s4dj0djvhk0p82bm80000gn/T/race-test-877575510.mp4: Invalid data found when processing input
{

}

=== Iteration 3/5 (id=race-test-1764972773977277000-2) ===
  Starting recording...
  Recording for 3 seconds...
  Calling stop 2 times concurrently...
  Downloading recording...
  Downloaded 20968 bytes
  Validating with ffprobe...
  Video duration: 3.600000 seconds
  Cleaning up...
✅ PASSED

=== Iteration 4/5 (id=race-test-1764972777850324000-3) ===
  Starting recording...
  Recording for 3 seconds...
  Calling stop 2 times concurrently...
  Downloading recording...
  Downloaded 21007 bytes
  Validating with ffprobe...
  Video duration: 3.600000 seconds
  Cleaning up...
✅ PASSED

=== Iteration 5/5 (id=race-test-1764972781717936000-4) ===
  Starting recording...
  Recording for 3 seconds...
  Calling stop 2 times concurrently...
  Downloading recording...
  Downloaded 20978 bytes
  Validating with ffprobe...
  Video duration: 3.600000 seconds
  Cleaning up...
✅ PASSED

=== RESULTS: 3 passed, 2 failed ===

What changed?

  • Scripts/Tooling: Added server/scripts/concurrent_stop_test/main.go to reproduce and validate concurrent recording stop behavior.
  • Dependencies: Added github.com/avast/retry-go/v5 dependency.
  • Repo: Ignored recordings/ directory in .gitignore.

Description generated by Mesa. Update settings

@Sayan- Sayan- removed the request for review from hiroTamada December 5, 2025 22:26
@Sayan- Sayan- requested a review from hiroTamada December 5, 2025 23:50
@Sayan- Sayan- merged commit bd49aff into main Dec 6, 2025
6 checks passed
@Sayan- Sayan- deleted the sayan/kernel-633-replay-stop-concurrency-issues-lead-to-empty-videos branch December 6, 2025 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants