Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gstd hangs on shutdown if pipelines are running #303

Open
jsidereal opened this issue Jun 28, 2022 · 1 comment
Open

gstd hangs on shutdown if pipelines are running #303

jsidereal opened this issue Jun 28, 2022 · 1 comment

Comments

@jsidereal
Copy link

With a build from master (currently at tag v0.14.0), gstd will hang on shutdown if any pipeline is running. Verified simply with the following gst-client commands:

$ cat foo.sh
#!/bin/bash
gst-client pipeline_create foo fakesrc ! fakesink
gst-client pipeline_play foo
gst-client read /pipelines/foo/state

Then send sigterm to (or Ctrl-C) gstd, upon which it will hang. I've tracked this down to dispose not being called on the session instance, but the reason why is not entirely obvious.

This problem actually exists at the previous tag (v0.13.2) as well, but the solution turns out to be simple:

diff --git a/gstd/gstd_ipc.c b/gstd/gstd_ipc.c
index 164db47..441e08a 100644
--- a/gstd/gstd_ipc.c
+++ b/gstd/gstd_ipc.c
@@ -153,9 +153,8 @@ gstd_ipc_start (GstdIpc * ipc, GstdSession * session)
   g_return_val_if_fail (ipc, GSTD_IPC_ERROR);
   g_return_val_if_fail (session, GSTD_IPC_ERROR);
 
-  ipc->session = g_object_ref (session);
-
   if (TRUE == ipc->enabled) {
+    ipc->session = g_object_ref (session);
     klass = GSTD_IPC_GET_CLASS (ipc);
     ret = klass->start (ipc, session);
   }
@ElkMonster
Copy link

I can confirm the issue (in v0.15.0), but the patch above does not fix it.

However, there's a workaround that might be helpful in some situation: sending SIGUSR1 instead of SIGTERM or SIGINT does terminate Gstd instantly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants