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 339574 - [patch] Race condition in multifdsink can lead to spurious duplicate clients
[patch] Race condition in multifdsink can lead to spurious duplicate clients
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other All
: Normal normal
: 0.10.7
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-04-24 14:19 UTC by Michael Smith
Modified: 2006-04-28 15:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (3.83 KB, patch)
2006-04-24 14:21 UTC, Wim Taymans
committed Details | Review

Description Michael Smith 2006-04-24 14:19:16 UTC
multifdsink has a client-removed signal, which is intended to be used so that an application can call the get-stats signal, and then close the file descriptor.

Unfortunately, if you do this, a new file descriptor (for a new client) with the same value as the old one you just closed, could get added before multifdsink removes the FD from its data-structures.

Multifdsink would reject this as a duplicate (which it is not).

To fix this, we need to add a new signal that is fired only once multifdsink no longer has any reference to the FD, to indicate to the application that it's safe to close (and thus later reuse) that FD.
Comment 1 Wim Taymans 2006-04-24 14:21:15 UTC
Created attachment 64204 [details] [review]
proposed patch

this patch adds a new signal that is fired when multifdsink has removed all references to the fd.
Comment 2 Wim Taymans 2006-04-28 15:31:39 UTC
        * gst/tcp/gstmultifdsink.c: (gst_multi_fd_sink_class_init),
        (gst_multi_fd_sink_remove_client_link):
        * gst/tcp/gstmultifdsink.h:
        Fix race condition in multifdsink that can lead to spurious
        duplicate clients. this patch adds a new signal that is fired when
        multifdsink has removed all references to the fd.
        Fixes #339574.
        Updated documentation.
        API: client-fd-removed signal added