Skip to content

Commit 3fdc807

Browse files
authored
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 shaka-project/shaka-streamer#195 for details.
1 parent 0857653 commit 3fdc807

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packager/file/http_file.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ ABSL_FLAG(bool,
4646
false,
4747
"Disable peer verification. This is needed to talk to servers "
4848
"without valid certificates.");
49+
ABSL_FLAG(bool,
50+
ignore_http_output_failures,
51+
false,
52+
"Ignore HTTP output failures. Can help recover from live stream "
53+
"upload errors.");
4954

5055
ABSL_DECLARE_FLAG(uint64_t, io_cache_size);
5156

@@ -257,7 +262,7 @@ Status HttpFile::CloseWithStatus() {
257262
const Status result = status_;
258263
LOG_IF(ERROR, !result.ok()) << "HttpFile request failed: " << result;
259264
delete this;
260-
return result;
265+
return absl::GetFlag(FLAGS_ignore_http_output_failures) ? Status::OK : result;
261266
}
262267

263268
bool HttpFile::Close() {

0 commit comments

Comments
 (0)