Refactor PushClient to improve robustness and error handling#3
Refactor PushClient to improve robustness and error handling#3nglmercer wants to merge 15 commits into
Conversation
The client state handling and network tasks have been significantly refactored to prevent resource deadlocks and unbounded memory growth. This includes proper buffering of media before publication, graceful shutdown procedures, and enhanced logging for connection status. Key changes: - Added bounded media buffers with LRU eviction for video/audio frames to prevent memory leaks - Implemented structured background tasks for TCP reading/writing with proper cancellation - Added sequence header caching and pre-publication buffering to ensure stream continuity - Enhanced RTMP event handling to detect connection failures and reject streams appropriately - Improved logging for connection status, errors, and shutdown events - Simplified TLS connection setup and error propagation
|
i feel that this code is ai-generated but i cant prove it |
Juanperias
left a comment
There was a problem hiding this comment.
There are a lot of comments that simply clutter up the code and add nothing (I know these comments are made with AI).
Example:
// FIXED: Collapsed nested if let
if let Some(meta) = &state.prepublish_metadata
&& let Ok(res) = state.session.publish_metadata(meta)
{
Self::send_packet(tx, res);
}
// FIXED: Collapsed nested if let
// ...|
My opinion is no, this should not be merged! As long as the code is still riddled with AI slop. If the solution is correct, then fine, but there wasn't human intervention, which makes reviewing the PR extremely tedious, not to mention that the AI tends to break the codebase. Even so, @SergioRibera is the one managing the project, so the final decision is up to him |
Create reestream-srt with listener and sender implementations, configuration, and error handling. Update workspace and roadmap to reflect new protocol support.
Introduce graceful shutdown, rate limiting, and connection pooling in reestream-core. Add webhook module to reestream-server for stream event notifications. Enable SRT feature in main crate with proper dependency management.
- Simplify error responses in stop_recording and delete_recording - Clone input and path for async task ownership in RecordingManager - Adjust build_ffmpeg_args to accept &Path instead of &PathBuf
|
Lo lograron. Finalmente lo rompieron. Finalmente ganaron. Destrozaron a alguien. A alguien que siempre estaba feliz, que siempre estaba sonriendo. A alguien que no merecía el odio. A alguien que no hacía nada más que ayudar a las personas. A alguien que amó con todo su corazón. Finalmente lo lograron. |
The client state handling and network tasks have been significantly refactored to prevent resource deadlocks and unbounded memory growth. This includes proper buffering of media before publication, graceful shutdown procedures, and enhanced logging for connection status.
Key changes: