From d3a4e1455f4e7bfa4e0a5aa2ca712a216ade537f Mon Sep 17 00:00:00 2001 From: hadaq Date: Tue, 9 Aug 2011 14:56:08 +0000 Subject: [PATCH] Second try: Bugfix in eventbuilding: when master stream had lost a trigger sequence number (possibly by udp layer), eventbuilder could not recover subevent synchronization -> increase of discarded events until regular program exit. This was observed at Aug2011 beamtime several times per day with cosmic and test runs. Workaround with a delayed pop of master stream queue. Try: Added free of shared mem and queue, since eb was stuck with previous version... JAM --- hadaq/evtbuild.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hadaq/evtbuild.c b/hadaq/evtbuild.c index 9de629c..8855263 100644 --- a/hadaq/evtbuild.c +++ b/hadaq/evtbuild.c @@ -1,4 +1,4 @@ -static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.148 2011-08-09 11:33:20 hadaq Exp $"; +static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.149 2011-08-09 14:56:08 hadaq Exp $"; #define _POSIX_C_SOURCE 199309L #define SYSLOG_NAMES @@ -1310,6 +1310,12 @@ int main(int argc, char *argv[]) if (popMaster) { /* Regular case: delayed pop of last master stream entry after check ok */ HadTuQueue_pop(hadTuQueue[0]); + if (HadTuQueue_empty(hadTuQueue[0])) { + desHadTuQueue(hadTuQueue[0]); + free(hadTuQueue[0]); + hadTuQueue[0] = NULL; + ShmTrans_free(shmTrans[0]); + } } else { /* display error and keep last event in hope for later synchronization */ sprintf(msglog, " Master message stream has missed trigger sequence nr:%d. Kept subevent nr %d in master queue", -- 2.43.0