Repository navigation
file-updater: Report a failed download so ingest refresh waits end (#1347) - #1353
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #1347 (parent #1273, follow-up to #1326).
Problem
shared/file-updaternever calls the update callback when the HTTP request fails, so the rtmp-services refresh-done event from #1326 is never signalled and callers wait the full timeout (3 s on the output connect thread, 5 s on the UI thread in the auto-config wizard).Users audited
plugins/rtmp-services/service-specific/service-ingest.c.h(Twitch, Amazon IVS):update_info_create_single+ wait. Changed.plugins/rtmp-services/service-specific/dacast.c.h:update_info_create_single+ wait. Changed.plugins/rtmp-services/rtmp-services-main.c.h(services list):update_info_create(package mode), no waiter. Unchanged.plugins/win-capture/plugin-main.c.h(compatibility list):update_info_create, no waiter. Unchanged.cmake/crossonly lists the include dir. Nothing outside repo-internal plugins includes the header; no libobs public header touched.Design
New
update_info_create_single_with_done(..., confirm_callback, done_callback, param)withtypedef void (*update_done_callback_t)(void *param, bool success). The done callback runs once on the updater thread when the attempt ends:falseon curl/HTTP failure or empty body (confirm callback never called), else the confirm callback's return.update_info_create_singleforwards withdone_callback = NULL, so existing users see exactly the old behaviour. service-ingest and dacast pass a done callback that callsingest_refresh_wait_complete(the manual-reset event; a second signal after a success is harmless).Tests
New
test/cmocka/test_file_updater_failure.c(tests.d/test_file_updater_failure.cmake, Linux, links libobs + OBS::file-updater only):failed_download_ends_wait: URL on a bound-then-closed localhost port; the wait (4 s timeout) must end in < 2 s, done(false), confirm never called.successful_download_reaches_confirm: one-shot local HTTP server thread; confirm gets the exact body, done(true).RED (206f069, stubbed API):
***Failed 4.03 sec— both cases fail (wait ran out the timeout; done never called), 290/291 others pass.GREEN:
run.sh --repeat 1 --tests test_file_updater_failure: passes in 0.03-0.06 s in both OFF and ON modes, 291/291.Real app not run, hence Refs.