Discussion:
[Bug 796797] New: Gstreamer RTSP client connects to Gstreamer RTSP
"GStreamer" (GNOME Bugzilla)
2018-07-12 10:40:36 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=796797

Bug ID: 796797
Summary: Gstreamer RTSP client connects to Gstreamer RTSP
server: Only fixed number of connections are possible,
then always "Error (503): Service Unavailable"
Classification: Platform
Product: GStreamer
Version: 1.14.1
OS: Windows
Status: NEW
Severity: normal
Priority: Normal
Component: gst-rtsp-server
Assignee: gstreamer-***@lists.freedesktop.org
Reporter: ***@online.de
QA Contact: gstreamer-***@lists.freedesktop.org
GNOME version: ---

Created attachment 373004
--> https://bugzilla.gnome.org/attachment.cgi?id=373004&action=edit
Wireshark trace of 5 successful connection and 20 not successful connections

I have a Gstreamer RTSP server, Gstreamer version 1.14.1 on Linux i.MX6.
I use a Gstreamer RTSP client, Gstreamer version 1.14.1 also on Linux i.MX6.
Both on same machine or on different machines, does not matter.
Linux is almost mainline latest.

Client side:

# cat stopme_5s
eos, name=Done-testing, playback-time=5.0
stop, playback-time=7.0

# cat run_streaming_5s_multiple_times.sh
echo "*************************************"
echo "*** HERE IS THE START OF THE TEST ***"
echo "*************************************"
./run_streaming_5s.sh
./run_streaming_5s.sh
./run_streaming_5s.sh
./run_streaming_5s.sh
./run_streaming_5s.sh
./run_streaming_5s.sh
./run_streaming_5s.sh
./run_streaming_5s.sh
./run_streaming_5s.sh
./run_streaming_5s.sh
./run_streaming_5s.sh
./run_streaming_5s.sh
./run_streaming_5s.sh
./run_streaming_5s.sh
./run_streaming_5s.sh
./run_streaming_5s.sh
./run_streaming_5s.sh
./run_streaming_5s.sh
./run_streaming_5s.sh
./run_streaming_5s.sh
./run_streaming_5s.sh
./run_streaming_5s.sh
./run_streaming_5s.sh
./run_streaming_5s.sh
./run_streaming_5s.sh

# cat run_streaming_5s.sh
gst-validate-1.0 --set-scenario stopme_5s rtspsrc
location=rtsp://10.5.121.255:8554/live ! capsfilter
caps=application/x-rtp,media=video ! rtph264depay ! identity silent=false !
fakesink
#

Server side:

Part of a bigger application.

When I let run the above test script, I see that I can connect 5 times,
but all further connects are rejected by "Error (503): Service Unavailable".

Major problem: Why only 5 connections? TCP is completely disconnected,
no still established connections? Does RTSP server not handle sudden
disconnects of the TCP connections and requires TEARDOWN to work
correctly?

Minor problem: Is it correct, that Gstreamer RTSP client (Element rtspsrc)
does not use a TEARDOWN message? Instead just disconnects?

I found https://bugzilla.gnome.org/show_bug.cgi?id=757624,
looks similar, but I assume that such an important bug is not existing for 3
years?

I attach a Wireshark trace and also a Gstreamer trace.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2018-07-12 10:41:49 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=796797

--- Comment #1 from Marie Maurer <***@online.de> ---
Created attachment 373005
--> https://bugzilla.gnome.org/attachment.cgi?id=373005&action=edit
Gstreamer Log of the 25 connection, first 5 successfuly, other 20 not
successful
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2018-07-12 10:42:03 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=796797

Marie Maurer <***@online.de> changed:

What |Removed |Added
----------------------------------------------------------------------------
OS|Windows |Linux
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2018-07-12 10:47:27 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=796797

--- Comment #2 from Marie Maurer <***@online.de> ---
The "5" connections seem to come from:

/* set the max number of sessions */
GstRTSPSessionPool *sessionPool = gst_rtsp_server_get_session_pool(m_server);
gst_rtsp_session_pool_set_max_sessions(sessionPool, MAX_CLIENTS);
g_object_unref(sessionPool);

with MAX_CLIENTS set to 5.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2018-07-12 11:28:36 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=796797

Sebastian Dröge (slomo) <***@coaxion.net> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@coaxion.net

--- Comment #3 from Sebastian Dröge (slomo) <***@coaxion.net> ---
Does it work if you set the required number there?
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2018-07-12 11:39:16 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=796797

--- Comment #4 from Marie Maurer <***@online.de> ---
I have set it to 5 and then 5 connections are possible.
I have not tried if I set number e.g. to 10, if 10 connections are possible.
All further connections are not possible.
No parallel connections! One after the other.

Where do I find variable, where open connections are counted?
Perhaps I can debug print the counter to see if it is increased
and decreased?
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2018-07-12 11:41:45 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=796797

--- Comment #5 from Sebastian Dröge (slomo) <***@coaxion.net> ---
Without teardown, the server will still send the media data via UDP. It's valid
to close the RTCP TCP connection, continue streaming, and later reconnect to
send further commands.

The server will timeout the sessions based on RTCP though, if enabled.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2018-07-12 11:55:35 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=796797

--- Comment #6 from Marie Maurer <***@online.de> ---
According your comment:
Many thanks for your explanation!
So a missing teardown is an error by Gstreamer RTSP client
or gst-validate-1.0 or of my script?
What does it mean "...timeout..., if enabled"?
Is there a function/property you have in mind?

I see "session pool reached max sessions of 5" 18 times in log.
It comes from
gst1-rtsp-server-1.14.1/gst/rtsp-server/rtsp-session-pool.c
Variable for max number seems to be "max_sessions".

GstRTSPSession *
gst_rtsp_session_pool_create (GstRTSPSessionPool * pool)
{
...
/* check session limit */
if (priv->max_sessions > 0) {
if (g_hash_table_size (priv->sessions) >= priv->max_sessions)
goto too_many_sessions;
}
...
}
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2018-07-13 16:29:53 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=796797

--- Comment #7 from Marie Maurer <***@online.de> ---
Is this the right way to go?
Taken e.g. from
https://github.com/GStreamer/gst-rtsp-server/blob/master/examples/test-video.c

/* this timeout is periodically run to clean up the expired sessions from the
* pool. This needs to be run explicitly currently but might be done
* automatically as part of the mainloop. */
static gboolean
timeout (GstRTSPServer * server)
{
GstRTSPSessionPool *pool;

pool = gst_rtsp_server_get_session_pool (server);
gst_rtsp_session_pool_cleanup (pool);
g_object_unref (pool);

return TRUE;
}

and calling it periodically

/* add a timeout for the session cleanup */
g_timeout_add_seconds (2, (GSourceFunc) timeout, server);

There is

gst_rtsp_session_set_timeout (GstRTSPSession *session, guint timeout);

Is it also needed? Is the timeout only activated, when one is calling this
function? What is default value, when this function is not called?
What is a good/minimum value for this timeout? Does a low value have
disadvantages? E.g. a lot keep alive messages are exchanged?
(unfortunately the documentation is a bit less, not really describing
the important things. I refer to
https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-rtsp-server/html/GstRTSPSession.html#gst-rtsp-session-set-timeout
)
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2018-07-18 09:39:06 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=796797

--- Comment #8 from Marie Maurer <***@online.de> ---
Someone with knowledge? Is the above the right way to go?
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2018-11-03 15:42:25 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=796797

GStreamer system administrator <***@gstreamer.net> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |OBSOLETE

--- Comment #9 from GStreamer system administrator <***@gstreamer.net> ---
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been
closed from further activity.

You can subscribe and participate further through the new bug through this link
to our GitLab instance:
https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/issues/45.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
Loading...