Repository navigation
Description
Location
shared/file-updater/file-updater/file-updater.c.h:100-135 — do_http_request sets CURLOPT_FAILONERROR and CURLOPT_NOSIGNAL but no CURLOPT_CONNECTTIMEOUT/CURLOPT_TIMEOUT, so curl_easy_perform blocks on an unreachable host for the kernel's TCP connect timeout.
shared/file-updater/file-updater/file-updater.c.h:36-42 — update_info_destroy joins that thread with an unbounded pthread_join(info->thread, NULL).
plugins/rtmp-services/rtmp-services-main.c.h:104 starts the update thread at module load (update_info_create, under #if defined(ENABLE_SERVICE_UPDATES)); plugins/rtmp-services/rtmp-services-main.c.h:122 calls update_info_destroy(update_info) from obs_module_unload, i.e. on the shutdown path.
The caller that trips over it: test/packaged-startup.py:601 proc.wait(timeout=30) (after SIGINT at :542).
Class
Liveness/robustness defect — shutdown is blocked on an unbounded network call. Not memory-unsafe.
How it is reached
Exit while the rtmp-services service-list update is in flight and the update host is unreachable. That is (a) an offline or firewalled user who quits soon after launch, and (b) the packaging smoke test on a runner with no egress to obsproject.com.
Evidence — release-rust.yaml run 40529110726, job 122287574932 Native macOS x86_64 DMG startup, head b926b01c, macos-26 image 20260824.0517. Scenario 2 (migrate-default) failed with subprocess.TimeoutExpired in close_frontend. The app's own frontend log:
15:36:08.966 [rtmp-services] module loaded (update thread started)
15:36:09.559 ==== Shutting down ====
15:36:10.037 All scene data cleared
15:37:24.005 [rtmp-services plugin] Remote update of URL "https://obsproject.com/obs2_update/rtmp-services/v5/package.json"
failed: Failed to connect to obsproject.com port 443 after 75005 ms: Couldn't connect to server
15:37:24.007 [obs-websocket] [obs_module_unload] Shutting down...
Shutdown stalled ~74 s (15:36:10 → 15:37:24) and resumed only when the connect gave up. sample of the still-running process (the harness samples it after the timeout):
+ obs_module_unload (in rtmp-services) + 22
+ update_info_destroy (in rtmp-services) + 41
...
+ update_thread (in rtmp-services) + 1343
+ do_http_request (in rtmp-services) + 345
The harness's bound (proc.wait(timeout=30)) is shorter than the ~75 s connect timeout, so the job fails.
Why scenario 1 passed: in fresh mode the same fetch succeeded in ~0.1 s before shutdown was requested (Successfully updated file 'services.json' (version 295) / Successfully updated package (version 295), 15:35:59.78/59.88); in scenario 2 the fetch was still in flight and the host was unreachable, so the join blocked.
Related but a different fault: #2432 is a SIGSEGV on arm64 during the same shutdown family; this failure is a stall on x86_64 with no crash report (a hang produces no .ips, so #2432's "wait for a crash report" path cannot cover it).
Proposed fix and failing test
Fix (preferred): bound the request in do_http_request — add CURLOPT_CONNECTTIMEOUT (short, e.g. 15 s) and a total CURLOPT_TIMEOUT (e.g. 60 s), with a comment; CURLOPT_NOSIGNAL is already set so the timeout is thread-safe. An unreachable host then fails fast instead of holding update_info_destroy's join. This also bounds the twitch/dacast/amazon single-file updaters, which share do_http_request.
Alternative (not preferred): raise the smoke test's wait. Rejected: the test's 30 s bound is a legitimate product requirement (the app should exit promptly), and the OS connect timeout is environment-specific (~75 s macOS, longer on Linux), so any test-side constant is brittle.
Failing test (RED → GREEN): Tier 2 (cmocka), next to test/cmocka/test_file_updater_failure.c: create an update_info against a TEST-NET address (192.0.2.0/24, guaranteed unroutable) and assert update_info_destroy returns within a few seconds — RED it blocks for the OS connect timeout, GREEN it returns at the connect-timeout bound. A narrower unit is to assert do_http_request installs a connect timeout on its curl handle.
Not verified
- Not reproduced locally (needs a built macOS app plus a blackholed route); the diagnosis is from the run's own frontend log and
samplestack above. 75005 msis the value this runner measured; the per-OS bound is the kernel's TCP connect timeout, not a constant in the tree.- Duplicate check:
gh search issues/prsforrtmp-services remote update,obsproject.com connect,packaged startup shutdown timeout,file-updater timeoutreturn no matching issue (file-updater: Report a failed download so ingest refresh waits end (#1347) #1353 and file-updater, frontend: Ask only for codings the linked libcurl decodes (#2453) #2454 are file-updater changes, unrelated to a timeout).
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsDone
Activity
zackees commentedon Oct 27, 2026
/ready
Triage: the location, class, reach and fix are all named (a missing curl connect/transfer timeout in
do_http_request, joined unbounded byupdate_info_destroy), so this is Ready — size S, no open questions.zackees commentedon Oct 27, 2026
Claiming: #2672
Plan (one unit, one PR):
CURLOPT_CONNECTTIMEOUT(15 s) andCURLOPT_TIMEOUT(60 s) todo_http_requestinshared/file-updater/file-updater/file-updater.c.h, with a comment tying it to the unboundedpthread_joininupdate_info_destroy.update_infoat an unroutable TEST-NET host and fails whileupdate_info_destroyblocks for the OS connect timeout.First PR: this tick if the Tier 2 lane builds locally, otherwise next tick — I will open it as a draft as soon as the RED exists.
fix(file-updater): Bound the update request so an unreachable host ca…
zackees commentedon Oct 27, 2026
Progress (worker, obs-studio5): PR #2673, branch
fix/2672-file-updater-connect-timeout.343f534b—test/cmocka/test_file_updater_timeout.c(+tests.d/wiring): anupdate_infoagainst RFC 5737 TEST-NET-1,update_info_destroymust return in < 40 s. Test + wiring only; the fix is not in it.30d11d9c—CURLOPT_CONNECTTIMEOUT15 s +CURLOPT_TIMEOUT60 s indo_http_request, and adocs/features.mdledger line (Fixed upstream bugs / Stability — the missing deadline is upstream's too).Local RED evidence: the code sets no deadline (
file-updater.c.h:106-121), and a raw connect to192.0.2.1:81on this host takes the kernel default133.2 s(tcp_syn_retries=6) with no--connect-timeout— the ~75 s the macOS runner measured is the same OS default. This checkout has no warm Tier 2 build volume, so the RED/GREEN runs are on PR CI (the new cmocka case is Linux Tier 2); I did not build the app locally.Refs/Fixesboth #2672 and #2671 — the bound removes the 75 s shutdown stall that fails the packaged-startup smoke test.zackees commentedon Oct 27, 2026
Merged in #2673 (
42ed9b2e2). The rtmp-services remote update can no longer holdobs_module_unload->update_info_destroy->pthread_joinfor the OS TCP connect timeout.What landed:
shared/file-updater/file-updater/file-updater.c.h:CURLOPT_CONNECTTIMEOUT15 s +CURLOPT_TIMEOUT60 s indo_http_request, with the comment tying them to the unbounded join.test/cmocka/test_file_updater_timeout.c-- anupdate_infoagainst RFC 5737 TEST-NET-1 must haveupdate_info_destroyreturn in < 40 s (RED on master, GREEN with the bound).docs/features.mdledger line (Fixed upstream bugs / Stability).What's left: nothing in the fix. The
test/packaged-startup.py30 s shutdown budget is deliberately unchanged -- the connect bound (15 s) is what removes the ~75 s stall, so the budget now has headroom. #2671 (the macOS x86_64 DMG startup smoke test's shutdown timeout) was the same root cause and is closed with this.Checked while here: the other in-tree curl call sites are already bounded (
nimotv.c.h3 s,showroom.c.h30 s,whip-output.cpp.hpp8 s,RemoteTextThread.cpp.hpptimeoutSec), so no sibling of this gap remains.fix(file-updater): Bound the update request so an unreachable host ca…