How to return EOS upstream from GstAggregator

I have an element that is based on GstAggregator that aggregates over several sinkpads. It doesn’t make sense for the element to continue if any single one of its input pads have ended (EOS), so in that case I want the element to send EOS events downstream and return GST_FLOW_EOS on all sinkpads.

Before updating to GStreamer 1.24 this used to be pretty simple - I would just return GST_FLOW_EOS from the implementation for the aggregate() virtual method if gst_aggregator_pad_is_eos() returned true for any of the sinkpads, and then GstAggregator would just take care of the rest.

After updating to GStreamer 1.24 it appears that this is now a deadlock of sorts. The aggregators src task just pauses, and then it doesn’t consume buffers anymore - but it also doesn’t return GST_FLOW_EOS to upstream elements. It just blocks until the buffers are consumed, and they never are because the srctask isn’t running.

I have traced this to be caused by the commit that adds the “Restart srcpad task on stream-start”. Is this an unintended consequence of that commit, or have my element just always been handling this situation wrong, and just “by accident” been working like I wanted it to?

Discussion continued in https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3999