After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 786275 - adaptivedemux: busy loop when manifest changes liveness
adaptivedemux: busy loop when manifest changes liveness
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
unspecified
Other Linux
: Normal normal
: 1.13.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-08-14 11:42 UTC by Matthew Waters (ystreet00)
Modified: 2017-08-15 05:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
adaptivedemux: start/stop the manifest update loop on liveness or periodic update changes (2.43 KB, patch)
2017-08-14 11:43 UTC, Matthew Waters (ystreet00)
committed Details | Review

Description Matthew Waters (ystreet00) 2017-08-14 11:42:33 UTC
The scenario is, a manifest starts out in live mode but then the recording is finalized and a subsequent update changes the state to a non-live manifest when the server has finished recording/transcoding/whatever with the full list of fragments.  At this changeover, the manifest update task in adaptivedemux will busy loop.
Comment 1 Matthew Waters (ystreet00) 2017-08-14 11:43:56 UTC
Created attachment 357546 [details] [review]
adaptivedemux: start/stop the manifest update loop on liveness or periodic update changes
Comment 2 Sebastian Dröge (slomo) 2017-08-14 11:54:32 UTC
Review of attachment 357546 [details] [review]:

::: gst-libs/gst/adaptivedemux/gstadaptivedemux.c
@@ +4356,3 @@
+      gst_adaptive_demux_stop_manifest_update_task (demux);
+    }
+    gst_adaptive_demux_start_manifest_update_task (demux);

Shouldn't this be in an else case? You now stop the task and always start it again?
Comment 3 Matthew Waters (ystreet00) 2017-08-14 12:06:01 UTC
(In reply to Sebastian Dröge (slomo) from comment #2)
> Review of attachment 357546 [details] [review] [review]:
> 
> ::: gst-libs/gst/adaptivedemux/gstadaptivedemux.c
> @@ +4356,3 @@
> +      gst_adaptive_demux_stop_manifest_update_task (demux);
> +    }
> +    gst_adaptive_demux_start_manifest_update_task (demux);
> 
> Shouldn't this be in an else case? You now stop the task and always start it
> again?

start has the exact opposite conditions as the above stop internally in the function.
Comment 4 Sebastian Dröge (slomo) 2017-08-14 12:51:41 UTC
Comment on attachment 357546 [details] [review]
adaptivedemux: start/stop the manifest update loop on liveness or periodic update changes

Maybe add a comment then, it's confusing. But good to go otherwise
Comment 5 Brad Reitmeyer 2017-08-15 03:41:14 UTC
I verified that the patch does fix the high CPU usage on my system as well.
Comment 6 Matthew Waters (ystreet00) 2017-08-15 05:25:11 UTC
commit cbf4a44426ca98df8337768ed7bb8a87b5c169a3
Author: Matthew Waters <matthew@centricular.com>
Date:   Mon Aug 14 21:33:51 2017 +1000

    adaptivedemux: start/stop the manifest update loop on liveness or periodic update changes
    
    Scenario:
    A manifest starts out in live mode but then the recording is finalized
    and a subsequent update changes the state to a non-live manifest when
    the server has finished recording/transcoding/whatever with the full
    list of fragments.
    
    Without this patch, the manifest update task is never stopped on the
    live->non-live transition and will busy loop, burning through one CPU
    core.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=786275