EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: Consistently inconsistent behaviour when testing ADURL
From: Mark Rivers via Tech-talk <tech-talk at aps.anl.gov>
To: 'Simon Rose' <Simon.Rose at ess.eu>
Cc: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Thu, 2 Apr 2020 14:38:41 +0000

I suggest using gdb to figure out where it is hung the first time you launch it using Python.

 

I see you are loading URLDriver.db.  That is not what is distributed with ADURL, which is URLDriver.template.  How does it differ?

 

Mark

 

 

 

From: Tech-talk <tech-talk-bounces at aps.anl.gov> On Behalf Of Simon Rose via Tech-talk
Sent: Thursday, April 2, 2020 4:31 AM
To: tech-talk at aps.anl.gov
Subject: Consistently inconsistent behaviour when testing ADURL

 

Hello –

 

We have been seeing some strange behavior when testing ADURL. Note that we are building our EPICS modules in a docker environment that runs conda, so we can ensure consistent behavior across builds. We also use an environment similar to that at PSI with a require module that dynamically loads other EPICS modules.

 

We use a python script to test the startup of an IOC. Essentially it runs the IOC in a subprocess, waits a little while, sends the command “exit”, and then inspects the output to see if there were any problems.

 

Anyhow, what happens--consistently!--is that the first time you run this test after the ADUrl module is built is that it hangs when trying to read the stdout from the subprocess. You can then break out of it, and then running it a second (or third, or fourth, etc.) time exits as expected. Consistently.

 

The startup script that causes the issue is the following:

 

require adurl

require busy

 

epicsEnvSet("IOC",                          "iocURLTest")

epicsEnvSet("TOP",                         ".")

epicsEnvSet("PREFIX", "URL1:")

epicsEnvSet("EPICS_CA_MAX_ARRAY_BYTES","64000000")

epicsEnvSet("PORT",   "URL1")

 

URLDriverConfig("$(PORT)", 0, 0)

dbLoadRecords("$(adurl_DIR)/db/URLDriver.db","P=$(PREFIX),R=cam1:,PORT=$(PORT),ADDR=0,TIMEOUT=1")

 

iocInit()

 

If we remove the dbLoadRecords call, however, it works as expected.

 

To summarize:

 

  1. If you use the python wrapper to run the IOC using the above script, it hangs the first time. If you run it again (and again, and again), it exits as expected.
  2. If you instead begin by running the IOC directly from the command line, it runs as expected. If you follow this by using the python wrapper, then it also runs and exits as expected.
  3. The first run (and all subsequent ones) succeeds if you comment out the dbLoadRecords() line.

 

The above suggests that something funny happens the first time you run dbLoadRecords(), but I do not have any idea what that is.

 

We have a workaround at the moment, but this is just so mysterious and we would like to understand what exactly is happening here.

 

Thanks in advance,

 

Cheers,

 

Simon Rose

Software Engineer

European Spallation Source

 

 


References:
Consistently inconsistent behaviour when testing ADURL Simon Rose via Tech-talk

Navigate by Date:
Prev: Consistently inconsistent behaviour when testing ADURL Simon Rose via Tech-talk
Next: RE: NTNDArray array filter does not work on value Mark Rivers via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
Navigate by Thread:
Prev: Consistently inconsistent behaviour when testing ADURL Simon Rose via Tech-talk
Next: Macro substitution for a filename Daykin, Evan via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
ANJ, 02 Apr 2020 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·