Skip to content

linux-pipewire: Log the screencast portal teardown phases (#2099) - #2553

Merged
zackees merged 1 commit into
masterfrom
fix/2099-portal-teardown-phases
Oct 27, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/2099-portal-teardown-phases

Conversation

@zackees

@zackees zackees commented Oct 27, 2026

Copy link
Copy Markdown
Member

Refs #2099

test_screencast_portal_teardown still hangs to its 20 s alarm now and then (last seen on #2503, run 40365468404). With PORTAL_TEST_VERBOSE=1 from #2123, the hang on #2419 (job 121276394469) ends at:

[pipewire] Screencast session created
[pipewire] Response to select source received
[pipewire] Asking for monitor and window
Source 'capture' destroyed
[portals] Request cancelled

[portals] Request cancelled is printed from on_cancelled_cb (portal.c.h:144), which only runs from g_cancellable_cancel() in free_capture() (screencast-portal.c.h:1037). So by that line the deferred idle had already been dispatched and the capture was being freed on the loop thread: the hang is after the cancel, not in the reply handling the test is about.

Three unbounded steps follow it and none of them logs, so the alarm cannot say which one stuck:

  1. the rest of free_capture() — g_dbus_connection_signal_unsubscribe() and the free, after the cancel callback has logged;
  2. obs_shutdown(), which the scenario calls before unloading the plugin;
  3. screencast_portal_unload(), which also calls g_source_destroy() on finish_destroy_source from the unload thread while the loop thread may still be dispatching that source (screencast-portal.c.h:1310) — GSource is not thread-safe, so a stuck hand-off there is a candidate.

This adds four DEBUG lines so the next hang names the phase instead of narrowing to three functions by hand. No behaviour change, no test edits (the policy forbids changing the C test to make a fix pass), and the messages only appear with PORTAL_TEST_VERBOSE, which the test registration already sets.

The fix itself depends on which step the next failure reports; this PR is the instrument for it, so it says Refs, not Fixes. Local runtime evidence: the local Tier 2 build had to be aborted because another session on this machine was running a linux-validate container, so PR CI's Tier 2 lane (selected by the plugins/linux-pipewire path) is the compile and run check for this change.

The next test_screencast_portal_teardown hang stops after
'[portals] Request cancelled', which every remaining step can produce:
free_capture() itself, obs_shutdown(), or screencast_portal_unload().
None of them logs today, so the 20 s alarm shows only where the run had
been, not where it stuck.

These four DEBUG lines bracket the three steps; with PORTAL_TEST_VERBOSE
set by the test registration, the next CI hang names the function.
@zackees
zackees added this pull request to the merge queue Oct 27, 2026
@zackees

zackees commented Oct 27, 2026

Copy link
Copy Markdown
Member Author

Handed off to the coordinator.

All checks green including CI Gate ✅; the PR is queued (merge queue, position reported as already queued). Instrumentation only — Refs #2099, not Fixes: the hang is still to be identified from the next occurrence.

Merged via the queue into master with commit 2986194 Oct 27, 2026
36 checks passed
@zackees
zackees deleted the fix/2099-portal-teardown-phases branch October 27, 2026 04:48
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