Skip to content

Verify blocking sleep fix in retry logic#50

Merged
southernmagilla merged 1 commit intofix/rtmp-crashesfrom
copilot/sub-pr-48-again
Feb 1, 2026
Merged

Verify blocking sleep fix in retry logic#50
southernmagilla merged 1 commit intofix/rtmp-crashesfrom
copilot/sub-pr-48-again

Conversation

Copy link
Contributor

Copilot AI commented Feb 1, 2026

Review comment requested verification that the blocking thread::sleep in FFmpeg retry logic no longer blocks the async runtime.

Verification Result

The issue was already addressed in commit cbef645. The retry_group method containing the blocking sleep is now executed via tokio::task::spawn_blocking:

// server/src/main.rs
"retry_stream" => {
    let group_id: String = get_arg(&payload, "groupId")?;
    let event_sink: Arc<dyn EventSink> = Arc::new(state.event_bus.clone());
    let ffmpeg_handler = state.ffmpeg_handler.clone();
    // Offloads blocking thread::sleep to Tokio's blocking thread pool
    let (pid, next_delay) = tokio::task::spawn_blocking(move || {
        ffmpeg_handler.retry_group(&group_id, event_sink)
    })
    .await
    .map_err(|e| format!("Task join error: {e}"))??;
    Ok(json!({
        "pid": pid,
        "nextDelaySecs": next_delay.map(|d| d.as_secs())
    }))
}

This ensures the async runtime remains responsive during exponential backoff delays while processing multiple concurrent streams.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI mentioned this pull request Feb 1, 2026
Copilot AI changed the title [WIP] Address feedback on 'Fix/rtmp crashes' PR Verify blocking sleep fix in retry logic Feb 1, 2026
Copilot AI requested a review from southernmagilla February 1, 2026 00:07
@southernmagilla southernmagilla marked this pull request as ready for review February 1, 2026 00:08
@github-project-automation github-project-automation bot moved this from Todo to Done in SpiritStream Roadmap Feb 1, 2026
@southernmagilla southernmagilla merged commit 7ebaff6 into fix/rtmp-crashes Feb 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants