From 2843b324cce1a82bad72255d67de97478571ea3e Mon Sep 17 00:00:00 2001
From: Rebecca Ewing <rebecca.ewing@ligo.org>
Date: Thu, 1 Jun 2023 16:13:51 +0000
Subject: [PATCH] gstlal-inspiral/bin/gstlal_inspiral: dont set state to null
 for online mode

---
 gstlal-inspiral/bin/gstlal_inspiral | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/gstlal-inspiral/bin/gstlal_inspiral b/gstlal-inspiral/bin/gstlal_inspiral
index c660534811..2146e703f5 100755
--- a/gstlal-inspiral/bin/gstlal_inspiral
+++ b/gstlal-inspiral/bin/gstlal_inspiral
@@ -1100,8 +1100,13 @@ for output_file_number, (svd_bank_url_dict, output_url, ranking_stat_output_url,
 	print("shutdown: del banks", flush=True, file=sys.stderr)
 	del banks
 
-	print("shutdown: Gstreamer set state to NULL", flush=True, file=sys.stderr)
-	stream.set_state(Gst.State.NULL)
+	# FIXME: error handling is broken and trying to
+	# set the state to NULL here for online data sources
+	# can sometimes cause the process to hang instead of
+	# exiting. So we'll just skip it for the online case
+	if not options.data_source in ("lvshm", "framexmit", "devshm"):
+		print("shutdown: Gstreamer set state to NULL", flush=True, file=sys.stderr)
+		stream.set_state(Gst.State.NULL)
 
 
 #
-- 
GitLab