Fix speaker-track readiness race: skip mixed-file wait when tracks exist

This commit is contained in:
2026-06-15 12:06:17 +00:00
parent 8fd5e5b464
commit 12f35ccdc3
4 changed files with 88 additions and 1 deletions
+10 -1
View File
@@ -287,7 +287,16 @@ async def process_recording(
)
return
if not await wait_for_file_ready(file_path):
# Speaker tracks are written and finalized independently in MeetingSink
# cleanup — they always have valid WAV headers if they exist. Check
# them first so we can skip the mixed-file "ready" wait (which is prone
# to timing races with the SilenceGenerator shutdown path).
if _load_speaker_tracks(file_path):
logger.info(
"Speaker tracks present for guild_id=%s; skipping mixed-file readiness check",
guild_id,
)
elif not await wait_for_file_ready(file_path):
reason = "recording file was not finalized in time"
await _save_retry_state(guild_id, file_path, fallback_channel_id, reason)
await safe_send_chunked(