Skip to content

file-updater: Report a failed download so ingest refresh waits end (#1347) - #1353

Merged
zackees merged 3 commits into
masterfrom
fix/1347-file-updater-failure
Oct 17, 2026
Merged

zackees merged 3 commits into
masterfrom
fix/1347-file-updater-failure

Conversation

@zackees

@zackees zackees commented Oct 17, 2026

Copy link
Copy Markdown
Member

Refs #1347 (parent #1273, follow-up to #1326).

Problem

shared/file-updater never 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/cross only 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) with typedef void (*update_done_callback_t)(void *param, bool success). The done callback runs once on the updater thread when the attempt ends: false on curl/HTTP failure or empty body (confirm callback never called), else the confirm callback's return. update_info_create_single forwards with done_callback = NULL, so existing users see exactly the old behaviour. service-ingest and dacast pass a done callback that calls ingest_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.

…1347)

update_info_create_single_with_done adds an optional done callback called
once when a single-file attempt ends, failure included. service-ingest and
dacast use it to signal the refresh-done event; other users are unchanged.

Refs #1347
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant