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 750991 - rtsp-session: session is not finalized when connection closed by accident.
rtsp-session: session is not finalized when connection closed by accident.
Status: RESOLVED NOTABUG
Product: GStreamer
Classification: Platform
Component: gst-rtsp-server
git master
Other All
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-06-15 12:11 UTC by Hyunjun Ko
Modified: 2015-06-23 02:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
rtsp-client: finalize session after unexpected disconnection happens (1.12 KB, patch)
2015-06-15 12:16 UTC, Hyunjun Ko
none Details | Review

Description Hyunjun Ko 2015-06-15 12:11:32 UTC
Normally, at EOS, client would send TEARDOWN msg and session is finalized properly with teardown logic in handle_teardown_request
But unexpected disconnection happens, this session is not finalized.

During unexpected disconnection, client_watch_notify callback is called and call gst_rtsp_client_session_filter. 
IMHO, in this function, session is expected to be finalized but ref count 1 remains in gst_rtsp_client_session_filter.
And this session is not removed from rtsp-session-pool. 
If user set maximum session, this also causes another problem, which is that rtsp server doesn't create session any more even though there is enough to create.
Comment 1 Hyunjun Ko 2015-06-15 12:16:21 UTC
Created attachment 305282 [details] [review]
rtsp-client: finalize session after unexpected disconnection happens

Calls gst_rtsp_session_pool_remove in cleanup_session to finalize the session and remove from session pool
Comment 2 Hyunjun Ko 2015-06-22 10:59:42 UTC
Reproduce step to see the problem.

1. Run rtsp-server with set 1(to reproduce easily) to max sessions by gst_rtsp_session_pool_set_max_sessions.

2. A client connects to this server by gst-launch playbin, and after playing, Ctrl+C to break. ( client doesn't send TEARDOWN, I have no idea this is a bug of rtspsrc )

3. Retry to connect, server denies to accept. Because client session's number is over max session value (in this example, 1 ). This is because server doesn't clear the previous session during disconnection.
Comment 3 Hyunjun Ko 2015-06-23 02:16:28 UTC
This is not a bug. server should get the signal "session-removed" and handle it.
And this patch causes failure of check/gst/rtspserver:-(
Thanks!