Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021 
<== Date ==> <== Thread ==>

Subject: Re: Autosave and IOC shutdown
From: Ralph Lange <ralph.lange@gmx.de>
To: "Mooney, Tim M." <mooney@aps.anl.gov>
Cc: EPICS Core-Talk <core-talk@aps.anl.gov>
Date: Wed, 24 Sep 2014 11:26:25 +0200
Hi Tim,

(Sorry for sending to the wrong list. I had an email address entry labeled "Core-Talk" sending to tech-talk. Duh!)

Well played - as there's no distinct elaborate API for that stuff, the docs don't say too much.

There's a common pattern that is used in many places: global control variable plus a semaphore to wait for thread shutdown.
Look at dbScan.c or callback.c in BASE/src/ioc/db to get the idea.
Exit hooks registered using epicsAtExit() are called in reverse registration order. So, for a thread that uses services from Base: register late to be taken down early. (Autosave configuration is done well before iocInit - probably too early for its exit hook registration. Might be better to do it from the thread.)

BTW: All this is basically present in 3.14, so not restricted to 3.15.

Thanks a lot,
~Ralph


On 23/09/2014 18:02, Mooney, Tim M. wrote:
Hi Ralph,

I'd like to fix this.  There are several threads spawned by various synApps modules.  I'll read the 3.15 docs and see how to comply.

Tim Mooney (mooney@aps.anl.gov) (630)252-5417
Software Services Group (www.aps.anl.gov)
Advanced Photon Source, Argonne National Lab


________________________________________
From: Ralph Lange [ralph.lange@gmx.de]
Sent: Tuesday, September 23, 2014 10:34 AM
To: Mooney, Tim M.
Cc: EPICS Core-Talk
Subject: Autosave and IOC shutdown

Hi Tim,

EPICS 3.15 is trying to make it easier for an IOC to cleanly shutdown.
It add tests and better control over shutdown hooks.
Autosave, on the other hand, starts a thread - running the
save_restore() function - that is designed to never shut down.

That seems like a clear conflict of interests, that shows as frequent
error messages on shutdown:

A call to 'assert(dbLockIsInitialized)'
     by thread 'save_restore' failed in ../../../src/ioc/db/dbLock.c
line 255.
EPICS Release EPICS R3.15.0.1-DEV $$Date$$.
Local time is 2014-09-23 14:17:13.090976814 UTC
Please E-mail this message to the author or to tech-talk@aps.anl.gov
Calling epicsThreadSuspendSelf()
(Autosave trying to use cleaned-up stuff in Base.)

Do you have any thoughts on this?

Cheers,
~Ralph






Navigate by Date:
Prev: Re: Jenkins build became unstable: epics-base-3.15 #98 Andrew Johnson
Next: Re: Jenkins build became unstable: epics-base-3.15 #98 Michael Davidsaver
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021 
Navigate by Thread:
Prev: Jenkins build is back to normal : epics-base-3.15 #100 APS Jenkins
Next: Build failed in Jenkins: epics-base-3.15-win32 #67 APS Jenkins
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021 
ANJ, 26 Sep 2014 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·