-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Docker: Improve video recorder/uploader with async tasks and graceful shutdown #3042
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||||
CI Feedback 🧐A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
… shutdown Signed-off-by: Viet Nguyen Duc <[email protected]>
951a967 to
980e52d
Compare
Signed-off-by: Viet Nguyen Duc <[email protected]>
Signed-off-by: Viet Nguyen Duc <[email protected]>
1278a2a to
69e75a7
Compare
User description
Thanks for contributing to the Docker-Selenium project!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines, applied for this repository.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
Motivation and Context
Types of changes
Checklist
PR Type
Enhancement
Description
Add retry logic with configurable attempts and delays for upload failures
Implement async graceful shutdown with background process tracking
Add file integrity verification and checksum validation for uploads
Enhance logging with session IDs and detailed upload statistics
Implement graceful FFmpeg stop with metadata finalization grace period
Diagram Walkthrough
File Walkthrough
upload.sh
Add retry logic, file verification, and graceful shutdownVideo/upload.sh
readiness wait, and checksum verification
verify_file_ready()function to check file existence,readiness, and stability before upload
calculate_checksum()function to compute MD5 checksums forfile integrity verification
rclone_upload_with_retry()function with configurable retrylogic, checksum validation, and statistics tracking
wait_for_active_uploads()function to wait for background uploadprocesses during graceful shutdown
graceful_exit()to prevent duplicate execution, wait foractive uploads, and log upload statistics
shutdown is initiated
video.sh
Implement async graceful shutdown with background finalizationVideo/video.sh
graceful_stop_delayconfiguration for FFmpeg metadata finalizationgrace period
BASIC_AUTHheader initialization before conditionaloverride
stop_ffmpeg_graceful_async()function for async FFmpegtermination with background finalization
wait_for_pipe_to_drain()function to wait for upload queueprocessing before shutdown
wait_for_background_finalization()function to track andwait for background finalization processes
stop_recording()to support both async and sync modes withproper session tracking
with session IDs
graceful_exit()to wait for background finalization and pipedraining
recorder.conf
Remove fixed stop wait timeoutVideo/recorder.conf
stopwaitsecs=30configuration to allow graceful shutdown tocomplete naturally
uploader.conf
Remove fixed stop wait timeoutVideo/uploader.conf
stopwaitsecs=30configuration to allow graceful shutdown tocomplete naturally
docker-compose-v3-video-upload-standalone-arm64.yml
Add ARM64 standalone video upload docker-compose exampledocker-compose-v3-video-upload-standalone-arm64.yml
FTP upload
containers
stop_grace_period: 30sfor graceful shutdown of containers