feat: Add option to ignore HTTP output failures (#1449)

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 https://github.com/shaka-project/shaka-streamer/issues/195 for details.
This commit is contained in:
Joey Parrish 2024-11-11 10:00:09 -08:00 committed by GitHub
parent 0857653338
commit 3fdc807ed3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -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);
@ -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() {