Skip to content

Commit

Permalink
feat: Add option to ignore HTTP output failures (#1449)
Browse files Browse the repository at this point in the history
When uploading a live stream, if a single segment upload fails, we shouldn't give up.

This adds an option to ignore HTTP output failures so that a single failed upload does not result in a hung stream.  See shaka-project/shaka-streamer#195 for details.
  • Loading branch information
joeyparrish authored Nov 11, 2024
1 parent 0857653 commit 3fdc807
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packager/file/http_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ ABSL_FLAG(bool,
false,
"Disable peer verification. This is needed to talk to servers "
"without valid certificates.");
ABSL_FLAG(bool,
ignore_http_output_failures,
false,
"Ignore HTTP output failures. Can help recover from live stream "
"upload errors.");

ABSL_DECLARE_FLAG(uint64_t, io_cache_size);

Expand Down Expand Up @@ -257,7 +262,7 @@ Status HttpFile::CloseWithStatus() {
const Status result = status_;
LOG_IF(ERROR, !result.ok()) << "HttpFile request failed: " << result;
delete this;
return result;
return absl::GetFlag(FLAGS_ignore_http_output_failures) ? Status::OK : result;
}

bool HttpFile::Close() {
Expand Down

0 comments on commit 3fdc807

Please sign in to comment.