shaka-project / shaka-packager

A media packaging and development framework for VOD and Live DASH and HLS applications, supporting Common Encryption for Widevine and other DRM Systems.
https://shaka-project.github.io/shaka-packager/
Other
1.9k stars 496 forks source link

Shaka hangs on http upload if curl does not read upload cache #1347

Closed petzeb closed 4 months ago

petzeb commented 4 months ago

System info

Operating System: Ubuntu 20.04.6 LTS (Focal Fossa) Shaka Packager Version: main, sha: 76eb2c1575-release

Issue and steps to reproduce the problem

Packager Command:

packager -v=3 input=short_h264_video.mp4,stream=0,init_segment=output/init.mp4,segment_template=output/$Number%05d$.mp4 --segment_duration=10 --fragment_duration=10 --use_fake_clock_for_muxer=1 --io_block_size=65536 --time_shift_buffer_depth=50 --preserved_segments_outside_live_window=0 --mpd_output=http://localhost:43831/dash.mpd

Extra steps to reproduce the problem? (1) Setup a local web server to receive the manifest updates, and configure the webserver to respond with an error code (403 for example) on each request. (2) Run repeatedly until shaka hangs, it appears this issue is timing sensitive.

What is the expected result? Shaka exits unsuccessfully

What happens instead? Shaka hangs.

Input file is probably not important here, but for reference it was generated via:

ffmpeg -f lavfi -i testsrc=duration=10:size=1280x720:rate=30  -t 10s  sample-content/short_h264_video.mp4

Problem was originally discovered on shaka 2.6.1, attaching abbreviated verbose logs from that run (with some additional locally added logs). Issue is verified to reproduce on shaka main, but could not get the log verbosity to work well enough to extract logs there.

shaka_hangs_abbrev.log

From the logs it can be seen that, HttpFile::Flush() is entered but not exited:

stderr(372): [0220/063540:VERBOSE2:http_file.cc(265)] Flush enter

There are no logs from HttpFile::CurlReadCallback() and the main process has finished:

stderr(424): [0220/063540:VERBOSE1:status.cc(74)] 7 (HTTP_FAILURE): HTTP response code said error, response code: 403.
stderr(425): [0220/063540:VERBOSE2:http_file.cc(363)] ThreadMain about to finish
stderr(426): [0220/063540:VERBOSE2:http_file.cc(367)] ThreadMain finished
joeyparrish commented 4 months ago

Thank you for the report! We will investigate.