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  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: CAJ Flow Control Bug
From: David Brodrick <[email protected]>
To: EPICS Tech-Talk <[email protected]>
Date: Mon, 23 May 2011 15:17:00 +1000
Hi,
We've been doing some scalability tests on our Java software that uses JCA/CAJ.

I came across a CAJ problem which resulted in all monitor events from an instance of our test IOC ceasing to arrive. Then another instance would stop sending events, etc.. Eventually CAJ wasn't giving me any monitor events at all.

I have tracked this down to the processRead method in com.cosylab.epics.caj.impl.CATransport. Basically if flow control gets enabled, and then there is a zero-byte read, then flow control never gets turned off and we never hear from the IOC again. I have addressed the bug by checking the flow control logic before checking for the zero-byte read, something like this:

 // read
 int bytesRead = channel.read(socketBuffer);
 if (bytesRead < 0)
 {
   // error (disconnect, end-of-stream) detected
   close (true);
   return;
 }
// flow control check
 if (socketBuffer.hasRemaining())
 {
   // buffer not full, disable flow control
   bufferFullCount = 0;
   if (flowControlActive)
     disableFlowControl();
} if (bytesRead == 0) {
   break;
 }

Perhaps the CAJ maintainers would like to incorporate this fix or something similar into the upstream source?

Regards,
 David


Replies:
Re: CAJ Flow Control Bug David Brodrick

Navigate by Date:
Prev: Problem building 3.14.12.1 on cygwin-x86 Mark Rivers
Next: Re: caGateway crashes / use of *MustSucceed functions Dirk Zimoch
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Problem building 3.14.12.1 on cygwin-x86 Mark Rivers
Next: Re: CAJ Flow Control Bug David Brodrick
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·