Skip to content

Fix postcoh event forwarding

Timothy Davies requested to merge tdavies__fix_py2_merge into gstreamer_python_upgrade

Tests on gstreamer_python_upgrade often never ended, due to missing an EOS event. I've traced it back to the event forwarding in Postcoh, where the messages/state changes seemed to end.

There's 2 possible explanations:

  • Suspect A: The srcpad upstream-event-forwarding loop. It turns out I'd replaced a loop using an overly complex gstreamer iterator with what I thought was the same thing, simplified down, as we do everywhere else in the codebase.
    • It might be that the old version, with its 'resync' cases, means that if the receiving pad is modified by another thread, we'll keep retrying. So maybe it was just an async issue.
    • Logs seem to indicate that this Isn't the issue, since I get 'eos' events on the sinkpad instead. However, this forwarding is used for the 'seek' event at the start of the pipeline.
    • See the src_event function, and all the functions it calls. It needed some reworking from gst-0.10 to use gvalues in the GstIteratorFoldFunction.
  • Suspect B: The default event handler. We generally didn't fallback to the default event handler properly. I added a fallback everywhere we don't explicitly prevent it, and used the correct gst_pad_event_default, instead of using a pointer stored on postcoh to the 'original' pad event function (which under the hood might not necessarily be the default function).
    • The srcpad will now both forward events upstream manually, then call the default event handler.
    • sink_event is basically unchanged, it just uses gst_pad_event_default now.

I also fixed a couple more merge issues, these ones were py2 print statements which had been copied by the merge. That merge had enough issues that maybe another read-through is warranted, but at this stage I'm happy to just fix bugs as I encounter them.

Besides that, it's just touchups as I was debugging.

I've tested by doing 100s runs, 10 at a time. Prior to these changes, they failed reliably UNLESS I ran with debug enabled, which I'm guessing slowed it down enough that async issues resolved themselves. I reduced some debug (see making postcoh 1.4 removal TRACE instead of LOG). The new version seems to work (including some extra in the GSTLAL appsync element): image ... image

Each run dumps zerolags and exits.

Merge request reports